Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Fulltext boolean search v.2.2 for vB Details »»
Fulltext boolean search v.2.2 for vB
Version: 1.00, by JohnWoo JohnWoo is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-07-2004 Last Update: Never Installs: 20
 
No support by the author.

Hello all!

Moving here from beta forum
https://vborg.vbsupport.ru/showthread.php?t=62218

This hack makes nearly same for vB3 as
[vB 2.2.x] - Mysql 4 Search hack
https://vborg.vbsupport.ru/showthread.php?t=51716
for vB2

You will need MySQL server v4.0.1 or better (but sometimes it may work on 3.23.xx). After installing you will be able to search with empty native vB index (word and postindex tables) and using modifiers.
Allowed modifiers + are ,-, * and "
All modifiers except * should be used only once for one word (in the beginning and without space).
* it should be used at the end of a word.
For example:
windows unix -> will find messages containing at least one these words.
+windows +unix -> will find messages with both this words.
windows* -> will find "windows", "windowss", "windowssauce" or "windowst".
*indows will NOT find "windows"
"some words" -> will find "some words of wisdom", but will not find "some extra words".
Search phrase length limitations replaced with results number limitation.
Value of old "Search Index Maximum Word Length" used to limit number of posts in the result returned by fulltext search (control panel/Message Searching Options)
Supposed that it must run faster then native vB search

History:
v.2.2 [5 Apr 2004]
- search words relevance (when sort by relevance) added at last
but little different then native vB (it may not work when searching with * modifiers)
- attempt to fix incompatibility with other hacks
=to upgrade replace code block #5 in search.php with latest one

v.2.1 [4 Apr 2004]
- Excluding from search forums with "Index New Posts in Search Engine" option set to "No"

v.2.0 [30 Mar 2004]
-"Similar Threads" now must start working (to move from 1.x to 2 just change one more script - functions_search.php)

v.1.9 [29 Mar 2004]
-checking if $query string is not empty before running fill text sql

v.1.8 [20 Mar 2004]
- line numbers and higlight code changed for VB3 Gold
- more tests and error explanations

v.1.7 [9 Mar 2004]
- MySQL error for administrators bug fixed
checking is $not_forumid string exixts before adding it to query

v.1.6 [9 Mar 2004]
- national letters bug fixed
preg_replace("~[^\w\"\-+\* ]~i", "", $query);
was replaced by
preg_replace("~[^\w\xC0-\xFF\"\-+\* ]~i", "", $query);

v.1.5 [8 Mar 2004]
- TABLE_PREFIX bug fixed
- slightly optimised SQL requests

v.1.4 [8 Mar 2004]
- delete_post_index function turned off
- more tests and error explanations

v.1.3 [7 Mar 2004]
- less code because of using native vB $postQueryLogic and $threadQueryLogic conditions
- more tests and error explanations

v.1.2 [7 Mar 2004]
- boolean mode can be turned off in AdminCP ("Allow Search Wild Cards" setting)
- "titles only" search fixed
- limiting number of matches retunned by fulltext search AFTER applying search conditions

v.1.1 [7 Mar 2004]
- HighLight support added

Show Your Support

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

Comments
  #72  
Old 04-03-2004, 07:36 PM
dslteam dslteam is offline
 
Join Date: Apr 2002
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello!

Great Hack! We use vb3 gold with about 320.000 posts and I have just installed it. On our Dual AMD MP 2.5 Ghz - the installation (with these DB queries) took about 23 seconds.

The search performance is indeed much better now.

Thanks!
Reply With Quote
  #73  
Old 04-03-2004, 09:45 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes.. You are right msimplay. I missed that thing.
Uploading updated zip and to upgrage just change in search.php

Code:
//fast list of forums visible and searchable for user
	foreach ($bbuserinfo['forumpermissions'] AS $forumid => $fperms) {
		if (!($fperms & CANVIEW) OR !($fperms & CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) {
			$not_forumid .= $forumid." ";
		}
	}
to
Code:
//fast list of forums not visible or searchable for user
	foreach ($bbuserinfo['forumpermissions'] AS $forumid => $fperms) {
		if (!($fperms & CANVIEW) OR !($fperms & CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false) OR !($forumcache[$forumid]["options"] & $_FORUMOPTIONS["indexposts"])) {
			$not_forumid .= $forumid." ";
		}
	}
Reply With Quote
  #74  
Old 04-03-2004, 09:57 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JohnWoo
Yes.. You are right msimplay. I missed that thing.
Uploading updated zip and to upgrage just change in search.php

Code:
//fast list of forums visible and searchable for user
  	foreach ($bbuserinfo['forumpermissions'] AS $forumid => $fperms) {
 		if (!($fperms & CANVIEW) OR !($fperms & CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) {
  			$not_forumid .= $forumid." ";
  		}
  	}
to
Code:
//fast list of forums not visible or searchable for user
  	foreach ($bbuserinfo['forumpermissions'] AS $forumid => $fperms) {
 		if (!($fperms & CANVIEW) OR !($fperms & CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false) OR !($forumcache[$forumid]["options"] & $_FORUMOPTIONS["indexposts"])) {
  			$not_forumid .= $forumid." ";
  		}
  	}
that doesn't seem to work i can still search those forums
i tested with a another account thinking maybe it only applies to not admins
but no that doesn't seem to work
Reply With Quote
  #75  
Old 04-03-2004, 10:13 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm..
You are able to search in that forums typing "Key Words" in field on search page or you can see that forums after clicking some link (like unanswered post hack have)?
Reply With Quote
  #76  
Old 04-03-2004, 10:15 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have a staff forum which has a post called reported in there
i used the nav drop down
and typed in report*

but it seemed to work on showthread
but again not with unanswered posts

obviosly normal registered members can't see it due to permissions
coz thats a staff forum

but what about forums that are not protected by permissions and are still viewable but just don't want them to be searchable
for example a test forum where people test signatures avatars bbcode etc

just tested again your hack works on
showthread
advanced search
forumdisplay

not navbar
not unanswered
Reply With Quote
  #77  
Old 04-03-2004, 10:28 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Think that I need to think a little
But can you please try to replace 2 strings

unset ($postQueryLogic);
$postQueryLogic = array('post.postid IN(' . $postids . ')');

with one

$postQueryLogic[] ='post.postid IN(' . $postids . ')';

and say how it will go?

PS using unset because I still trying to give less job to database - sorry
Reply With Quote
  #78  
Old 04-03-2004, 10:37 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey sorry for bugging you
i have found a new bug
when you search this thread it returns results from other threads
Reply With Quote
  #79  
Old 04-03-2004, 10:59 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JohnWoo
Think that I need to think a little
But can you please try to replace 2 strings

unset ($postQueryLogic);
$postQueryLogic = array('post.postid IN(' . $postids . ')');

with one

$postQueryLogic[] ='post.postid IN(' . $postids . ')';

and say how it will go?

PS using unset because I still trying to give less job to database - sorry
this doesnt seem to work :disappointed:
Reply With Quote
  #80  
Old 04-04-2004, 07:07 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and how it is now? after v.2.2 changes ?
Reply With Quote
  #81  
Old 04-05-2004, 02:43 AM
jb605 jb605 is offline
 
Join Date: Feb 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just installed this hack on vB 3.0.0 gold version. I am running a chinese website. Chinese is multibyte language, and the words are not delimited by space. I thougt by using fulltext search, the searched keyword is matched against the fulltext index directly, so there is no need to build word index on post. Am I correct?

But now I got no search result at all. Can anybody give any hints?

Thanks a lot.
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 05:49 AM.


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.04933 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (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
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete