Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Boolean Search as Default in Advanced Search Options Details »»
Boolean Search as Default in Advanced Search Options
Version: 1.00, by Neutral Singh Neutral Singh is offline
Developer Last Online: Feb 2016 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 11-11-2005 Last Update: Never Installs: 2
Template Edits
 
No support by the author.

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:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-12-2005, 05:42 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boolean Search causes higher load than natural language, so I wouldn't recommend doing that.
Reply With Quote
  #3  
Old 11-12-2005, 11:21 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Agreed!
Reply With Quote
  #4  
Old 11-13-2005, 03:24 AM
Neutral Singh's Avatar
Neutral Singh Neutral Singh is offline
 
Join Date: Sep 2004
Location: Sikh Philosophy Network
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 02-10-2006, 02:32 PM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Apologies - works fine. My fault.
Reply With Quote
  #6  
Old 02-10-2006, 03:06 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 04-12-2006, 05:01 AM
dgerson dgerson is offline
 
Join Date: Dec 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:18 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03817 seconds
  • Memory Usage 2,275KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete