The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Mysql 4 Search hack Details »» | |||||||||||||||||||||||||
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:
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
|
Comments |
#62
|
||||
|
||||
This hack bypasses vB and uses MySQL 4's own search abilities. It does seem to have sped up my site.
|
#63
|
|||
|
|||
I am sorry, but do you still have the limit statements in the code? If so, this is one the reason for your speed incrase. For you no longer search the entire database, but only up until X returns are found, then it stops. If you have them still in, remove them and see. MySQL has always been able to search, they have just improved it in ver 4 with the caching for the most part.
Not sure, but your database may not be large enough to see if their is a difference in speed. Not sure though. But just adding limit statments to our code, user selectable, made our site 100% faster all around due to the tables not locking as often on large returns. Still looking for some real data and the author to return to support the hack. Even on his own site the phrase search does not seem to work. Thanks |
#64
|
||||
|
||||
The phrase search works just fine for me. And I definitely notice a faster search time as well.
|
#65
|
|||
|
|||
Question again...do you have the LIMIT statements still in the code? If I had to guess...I would say you do. For after teasting about 10 words on your site...all returned under 100 results. Thus I am guessing this is all why you see the search speed increase. Thanks
|
#66
|
||||
|
||||
This is what I am getting when I do a search for the word "code":
Quote:
|
#67
|
||||
|
||||
Can someone please tell me how to "drop the two fulltext indexes" in the post table?
Edit: I am having major problems after un-installing this hack. I followed the directions exactly, but now when I search for words like color, background, code or font it highlights the words in my PHP, code and quote boxes code. It throws off the boxes and everything? Can someone please tell me what is happening and maybe how to fix it? Edit again: NM, I figured it out. |
#68
|
||||
|
||||
You're right David. I removed the LIMIT statements from 2 of the queries and it seems to work much better now.
|
#69
|
||||
|
||||
Which 2 queries? And I figured out a way to get rid of the plus sign before the word searched if anyone is interested.
|
#70
|
||||
|
||||
If you search for LIMIT 25 and LIMIT 100 those should be the correct 2.
|
#71
|
||||
|
||||
Ok, I already took those 2 out. You said from 2 of the queries. I wanted to make sure I had the right 2. Thanks!
I finally got it working great! The highlight doesn't mess with the other stuff now. I had to redo the highlight statement, but that fixed it. Even on a small site, there is a major difference in the searching speed now. |
#72
|
||||
|
||||
Good work making the highlight work.
|
#73
|
||||
|
||||
Thank you, sir. It was a blast figuring it out.
|
#74
|
||||
|
||||
It is the best hack ever.
I was looking for it for half a year. I even started a thread here about this on vb.com |
#76
|
|||
|
|||
Sorry i haven't been around lately, been trying to learn the whole .NET thing and clockcrew.cc is sort of a ghost town now :\
I believe that taking out the LIMITs on the search query would slow it down, but i haven't done any benchmarking. here's what I did to fix the highlighting problem: on line 626 (approx) of search.php you will find: Code:
if ($search[querystring]!="") { $search[querystring]=urlencode($search[querystring]); $highlightwords="&highlight=$search[querystring]"; } else { $highlightwords=""; } Code:
if ($search[querystring]!="") { $search[querystring]=preg_replace("/ \-(.*) /"," ",$search[querystring]); $search[querystring]=preg_replace("/ \-(.*)$/","",$search[querystring]); $search[querystring]=str_replace("+","",$search[querystring]); $search[querystring]=str_replace('"',"",$search[querystring]); $search[querystring]=urlencode($search[querystring]); $highlightwords="&highlight=$search[querystring]"; } else { $highlightwords=""; } thanks for the kind words guys oh and gmarik, wheres the thread you started on vbulletin.com? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|