Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Default Search Type?


How do I change the Search type default to "comments"? I suspect controls\search.php but I don't know enough about php to decipher how to do a default checked radio option.



  • MarkMark Vanilla Staff
    Actually, there isn't a way to do that right now without getting into the code. You should add this to the feature request list on the wiki (check out the bugs page)
  • What about removing the search type? It's unnecessary, I think. Reason: when you type a keyword, it's quite obvious what you're searchin for. The keywords for user names and discussion content don't uverlap much. Let's consider few search scenarios and expected results: “Whisperâ€? -- I expect discussions with “Whisperâ€? in the discussion topic at the top. Discussions with “Whisperâ€? in comments should also appear, as the next results. “Markâ€? -- I expect user “Markâ€? appear at the very top. Then discussions with “Markâ€? in the topic. Then “Markâ€? in comments. “Stripeâ€? -- users “3stripeâ€? and “3stripe@workâ€? appears at the top. It's not what I was looking for, because I was looking for a background with stripes, but since it's just 2 users, I don't mind it. Then “Stripeâ€? in topics, then “Stripeâ€? in comments. If you don't want to use weights, you can just merge results: First show user search. Second topic search. Comments search as the third. When you want to find all users, you can always use the “advancedâ€? search. So, what about removing the search type from the basic search form?
  • blizeHblizeH ✭✭
    It's a nice idea in principle but I really don't think it'd work, on a forum with loads of members it'd cause problems, as would searching for common words that you want to view the comments from, you'd have to scroll past countless discussions beforehand!
  • With such forum and such needs, there's always the advanced search at hand. I don't really see the point of searching for commond words. You always search for something specific.

    The point of merging the search types is to help the inexperienced users. Remember the old search engines? They would give you lots of options on how and where to search. And then came Google...
  • lechlech Chicagoland
    When you specify the type of search, it tells Vanilla exactly what rows to run the search through, making the search much faster, and removes the need to search the ENTIRE database. Otherwise, things would get bogged down with dozens if not hundreds of irrelevant search results thus making it pointless to run searches in the first place. In short, the search is fine as it is.
  • lechlech Chicagoland
    Although, an optional "Search through All" would be nice if you've completely misplaced something.
  • Yeah. Perhaps if the radio buttons were tickboxes instead..?
  • Not really relevant to the post but, I ask one thing.... I know on some forums and software when doing a search that includes a "common word" or a word in the "do not search for" type of lists, the search just quits. There is usually no error message, and if there is, the message does not tell you what happened. I know from way back in my phpbb days, searching their forum was horrible. Most of the time the page just wouldn't load, or it pops out some funky error that doesn't shed any light on what happened. So please, pretty please, if something like this ever is to happen, make a nice error message stating why the search was not performed. And maybe, even have the list of non-searchable / search-stopping words viewable by the user.
  • Minisweeper: Yes, the tickboxes instead, then turn them all on by default and hide them. Show them when user clicked “advancedâ€?. :)
  • ToivoToivo New
    edited June 2006
    "The point of merging the search types is to help the inexperienced users. Remember the old search engines? They would give you lots of options on how and where to search. And then came Google..." you will find the following categories on the googles homepage. web - images - groups - news - froogle - blog search ...
  • OK, let me narrow it down to the topic / comment choice. This is really unnecessary. I don't have to select “in titleâ€? or “in the page bodyâ€? radiobuttons in Google, do I? I'd like to have the same in Vanilla... :)
  • ToivoToivo New
    edited June 2006
    yes. mark could replace these with topic: comment: user: So the query would look like "+swell user:mark" I dont know how hard it is to implement.
  • There should be some weighting in the query--if the keyword appears in the title, its more likely a thread related to that keyword and should be ranked higher than something that appears in the body. Don't know how hard this would be to implement. Maybe my next project would be an search and indexing extension. Ha! As if I have enough time to finish my first.
This discussion has been closed.