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

Reply
 
Thread Tools
Mysql 4 Search hack Details »»
Mysql 4 Search hack
Version: 1.00, by traekwon traekwon is offline
Developer Last Online: Apr 2006 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-16-2003 Last Update: Never Installs: 18
Is in Beta Stage  
No support by the author.

MySQL 4 Search hack for Vbulletin 2.x.x - version 1.2 beta
Author: PineappleClock (pineappleclock@clockcrew.cc) aim: Janitor61
-------------------------------------

Overview
The MySQL 4 search hack modifies the search functionality in Vbulletin to take advantage of the new SQL functions available in MySQL 4.

Synopsis
This hack allows MySQL to index the posts and threads in your BBS instead of requiring vbulletin to do it.
This hack, when installed, will change the BBS in the following ways:
  • Vbulletin will not require the 'word' or 'searchindex' tables anymore - saving lots of space - instead it will use the 'post' table as an index.
  • Vbulletin will not catalog, reference and index every word of every post upon insertion into the database - saving tons of processing.
  • No need to regenerate the search index ever.
  • The 'post' table will increase in size by about 35%
  • Searches will be considerably faster, and posting will be somewhat faster.
  • Search strings will be able to contain phrases, like "lets share a soda", which can include small words that would of been blocked in vbulletin 2.x searches.
  • Advanced searches, containing included words, optional words, excluded words and exact phrases.

File Listing
install.txt -- the installation howto
simplesearch.txt -- a block of code that replaces a block of code in search.php
searchtemplate.txt -- a vbulletin template used for drawing the search form.

Requirements
MySQL 4.0.1 or newer - required
vbulletin 2.x.x - required (i've only tested it on 2.3.0 though)

How to check your MySQL version:
execute the following query:
Code:
SELECT @@global.version

Notes
The installation instructions assumes that you have access to database management software, like phpMyAdmin. If you can't edit your database directly, I can make a php script that will modify your database if there's enough demand.

The Vbulletin team aren't going to put in support for MySQL 4 until version 3.1 - so this hack should be obsolete by then.
If you'd like to see the modified search engine, go here:

http://www.clockcrew.cc/bbs/search.php

I was originally going to distribute the whole modified search.php file, but after reading the rules, im only distributing the modified part. Please let me know if you spot any bugs, etc. I've tested this, but there still are probably bugs i need to work out.

update [Apr 17]: added instructions on uninstalling

good luck!

Show Your Support

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

Comments
  #52  
Old 04-26-2003, 09:17 PM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good idea papoo. I was trying to figure out a way to make sure the " marks didn't appear in the url, but your method seems to work just fine.
Reply With Quote
  #53  
Old 04-26-2003, 11:05 PM
Yapluka Yapluka is offline
 
Join Date: Nov 2001
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Papoo is the king of ereg_replace :laugh:
Very nice hack ! Thanks so much... :banana:
Reply With Quote
  #54  
Old 04-30-2003, 01:07 PM
Da`Nacho Da`Nacho is offline
 
Join Date: Mar 2002
Location: Fort Worth, Texas
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The ereg_replace method above doesn't work for me, and if it did I'd be kind of leary of it since it's basically taking a step backward and really not solving the problem. (no offense to Papoo)

I've been comparing the original vBulletin search.php and the changes Traekwon made, seeing if I can figure out what the problem is for some of us. From what I can see it involves problems with quotes (") and extra plus signs (+) being inserted in queries, even single word queries... it's like the search thinks there is more than one word no matter what.

Of particular interest is the urldecode() lines that Traekwon seems to have removed... if I add it back for the masterquery (ie $masterquery = urldecode($masterquery); I can sort of get it working better, but not perfect.

Where did Traekwon drop off the face of the planet to, anyway.
Reply With Quote
  #55  
Old 05-03-2003, 06:15 PM
pstdgt pstdgt is offline
 
Join Date: Jul 2002
Location: constanta, romania
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this worked for me:

Code:
 $search[querystring]=urlencode($search[querystring]);
should be replaced with:
Code:
$search[querystring]=ereg_replace('[%2B|+]','',$search[querystring]);
Reply With Quote
  #56  
Old 05-13-2003, 02:59 PM
SemperFidelis SemperFidelis is offline
 
Join Date: May 2002
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This seriously sounds like a great hack.


But Im unable to test at your site (http://www.clockcrew.cc/bbs/search.php) as I keep getting this :
Code:
There seems to have been a slight problem with the clockcrew bbs database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.
Reply With Quote
  #57  
Old 05-19-2003, 07:29 AM
Da`Nacho Da`Nacho is offline
 
Join Date: Mar 2002
Location: Fort Worth, Texas
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Welp, I'm afraid I must uninstall this hack.

The lack of search terms being parsed right in the results (for highlighting) is just too annoying, and the only fixes I and others like me have been able to come up with are ereg_replace workarounds. It's like taking 2 steps forward and one step back...

What a shame...
Reply With Quote
  #58  
Old 05-19-2003, 09:55 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've stopped using the highlight term feature for over 1 year now since I have static URLs. So it's not a big loss.
Reply With Quote
  #59  
Old 05-27-2003, 12:37 AM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello...

I have an interest in using this hack for AVS Forum and TiVo Community Forum for the sites are large and past the point that the normal can be run without hurting the system.

In the site that the author lists as a test to see it in action...I find that "search for exact phrase:" does not seem to work at all and only returns that nothing is found. Not even if you try one one.

So..anyone know anything about this or has anyone seen the author of the hack posting anything, or updates, about this hack?

Thanks
Reply With Quote
  #60  
Old 05-27-2003, 12:54 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That feature works for me - I am able to find exact phrases - note that this hack automatically stops you from finding words that are too common automatically.
Reply With Quote
  #61  
Old 05-27-2003, 01:08 AM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pondering...so if you search for a phrase that has a word that is too common in it, then it will return nothing.

Also...

I think people are finding this search faster because of the limit statements in the search statements. Has anyone tried removing them all together? My guess is it would slow down again.

I have had to add limit statements to all of my searches and give the user an option to search with the number of returns, with the default being the lowest number of returns. The issue though when they look for more than one word. It will find the first set (say 500) and then look for the second word in only that 500 found. Gets worse with more that 2 words as you may guess.

In any case, we have found it is not the search itself, but the large number of returns that can sometime happen and TMP files need to be made for this. During that time, tables are locked and this the major slowdown on busy sites.

We just went MySQL ver 4 on new server and are currently going to be testing. I only hope MySQL 4 is much better in this reguard.
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 04:26 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.08158 seconds
  • Memory Usage 2,309KB
  • 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
  • (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
  • (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