PDA

View Full Version : Boolean Search as Default in Advanced Search Options


Neutral Singh
12 Nov 2005, 05:01
Boolean Search as Default in Advanced Search Options
[Should work in all vB 3.5.x versions.]

All Thanks to Jake Bunce, vBulletin Team

Context: I found that Boolean search option returns much more accurate and relevant results as compared to natural search option, which returns so many irrelevant results in comparison to boolean. So, i wanted to set the Boolean Search as default option while doing Advanced Search.



Admin CP -> Styles & Templates -> Style Manager -> -> Search Templates -> search_forums



Remove the red code:





<div style="padding:$stylevar[formspacer]px">

$vbphrase[search_type]

<label for="rb_searchtype_0"><input type="radio" name="searchtype" value="0" id="rb_searchtype_0" $searchtypechecked[0] />$vbphrase[natural_language]</label>

<label for="rb_searchtype_1"><input type="radio" name="searchtype" value="1" id="rb_searchtype_1" $searchtypechecked[1] />$vbphrase[boolean]</label>

</div>





Add the red code:





<div style="padding:$stylevar[formspacer]px">

$vbphrase[search_type]

<label for="rb_searchtype_0"><input type="radio" name="searchtype" value="0" id="rb_searchtype_0" />$vbphrase[natural_language]</label>

<label for="rb_searchtype_1"><input type="radio" name="searchtype" value="1" id="rb_searchtype_1" checked="checked" />$vbphrase[boolean]</label>

</div>




Thats it !!

Demo : http://www.sikhphilosophy.net

Click Install to encourage me to share such cute hacks with you all !! :nervous:

Andreas
12 Nov 2005, 06:42
Boolean Search causes higher load than natural language, so I wouldn't recommend doing that.

Snake
12 Nov 2005, 12:21
Agreed!

Neutral Singh
13 Nov 2005, 04:24
Well, it depends on the type of forum and the type of results you want to present to your members. My forums are content oriented and finding heaps of irrelevant search results only confuse the person and make it rather hard to trace the most relevant thread.

eg. if in my forums i search for a word : Banda Singh Bahadur (dialect)

Now, this search under natural search option returns full 11 pages of search as it provides information about any thread that contains either of the three words present in that thead like Banda,Singh,Bahadur. And the most relevant result for the search was figuring in around 7-8 page of results... useless to members in my case as nobody ever bothers to go through 7-8 pages to find the most relevant result.

Now, if we make the same search under Boolean search option, it returns only 2 pages of search results for those threads which contain the complete phrase "Banda Singh Bahadur". And the most relevant result was the 5-6 topic in the first search results page itself!! How happy my members would be to find that topic, i can well understand. ;)

You can test this example right on my forums --> http://www.sikhphilosophy.net


I have already suggested this to vb.com to make this option to be in the hands of the admin to allow boolean or natural search option. --> here (http://www.vbulletin.com/forum/showthread.php?t=162405) :nervous:

Till then enjoy this mod !! :devious:
Regards

Spinball
10 Feb 2006, 15:32
Apologies - works fine. My fault.

Andreas
10 Feb 2006, 16:06
Hmm ...


Search: Key Word(s): panasonic, subwoofer
Showing results 1 to 6 of 6
Search took 0.05 seconds. Search:

Panasonic SCHT-520 Subwoofer Problem
Panasonic SAXR55 - Causes subwoofer boom when switching inputs
Panasonic subwoofer
Which subwoofer for Panasonic SCPM91D ?
HELP!!! Panasonic system cable (connects subwoofer/amplifier to dvd unit)
Subwoofer for Panasonic SC-AK77 Mini System

Looks correct to me

dgerson
12 Apr 2006, 06:01
Answered my own question...

A: Boolean search is enabled in the Usergroup settings and requires full text search to be on. See this post (http://www.vbulletin.com/forum/showpost.php?p=1048620&postcount=7)
Q:

Anyone using this hack with VB3.5.4 and MySQL Full Text Search? I edited Search_Forums and couldn't find the original code:
<div style="padding:$stylevar[formspacer]px">

$vbphrase[search_type]

<label for="rb_searchtype_0"><input type="radio" name="searchtype" value="0" id="rb_searchtype_0" $searchtypechecked[0] />$vbphrase[natural_language]</label>

<label for="rb_searchtype_1"><input type="radio" name="searchtype" value="1" id="rb_searchtype_1" $searchtypechecked[1] />$vbphrase[boolean]</label>

</div>

When I inserted the replacement code into the template, it appeared as it should on the Advanced Search Page, but didn't seem to work.