vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Boolean Search as Default in Advanced Search Options (https://vborg.vbsupport.ru/showthread.php?t=100641)

Neutral Singh 11-11-2005 10:00 PM

Boolean Search as Default in Advanced Search Options
 
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.

Quote:

Originally Posted by Jake Bunce

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



Remove the red code:



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:



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 11-12-2005 05:42 AM

Boolean Search causes higher load than natural language, so I wouldn't recommend doing that.

Snake 11-12-2005 11:21 AM

Agreed!

Neutral Singh 11-13-2005 03:24 AM

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 :nervous:

Till then enjoy this mod !! :devious:
Regards

Spinball 02-10-2006 02:32 PM

Apologies - works fine. My fault.

Andreas 02-10-2006 03:06 PM

Hmm ...

Quote:

Originally Posted by Your search.php
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 04-12-2006 05:01 AM

Answered my own question...

A: Boolean search is enabled in the Usergroup settings and requires full text search to be on. See this post
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:
PHP 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.


All times are GMT. The time now is 06:12 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00996 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete