Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Mysql 4 Search hack Details »
Mysql 4 Search hack
Mod Version: 1.00, by traekwon (Member) traekwon is offline
Developer Last Online: Apr 2006 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (1 vote - 5.00 average) Installs: 18
Released: 17 Apr 2003 Last Update: Never Downloads: 11
Not Supported Is in Beta Stage  

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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!

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #31  
Old 22 Apr 2003, 04:16
jbourke jbourke is offline
 
Join Date: Nov 2001
The mysql docs state that anything 3 or less characters is not indexed.

Jim
Reply With Quote
  #32  
Old 22 Apr 2003, 18:06
mute mute is offline
 
Join Date: Dec 2002
Well there you have it, thanks Jim!

/me rtfms
Reply With Quote
  #33  
Old 22 Apr 2003, 19:31
jbourke jbourke is offline
 
Join Date: Nov 2001
Hmmm...this hack only returns the first few pages of results.

I'm going to have to revert to the old search engine if there isn't a way to fix this.

Jim
Reply With Quote
  #34  
Old 22 Apr 2003, 19:34
jbourke jbourke is offline
 
Join Date: Nov 2001
These two lines:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

both have limit statements.

Is there a problem with taking these out?

I don't mind experimenting but I'm a bit nervous because I have a pretty large forum.

Jim
Reply With Quote
  #35  
Old 22 Apr 2003, 19:42
Brad Brad is offline
 
Join Date: Nov 2001
Jim, increse them as you see fit, if you think you've gone to high revert them.
Reply With Quote
  #36  
Old 23 Apr 2003, 02:56
Da`Nacho Da`Nacho is offline
 
Join Date: Mar 2002
A few problems I am noticing, please someone verify with their setup:

When viewing a thread contained in search results the search terms are only hilighted on the first page of the thread.

When searching for a PHRASE and viewing a thread contained in those results, the search terms are not hilighted at all in the results and when you click to visit page 2 in the thread it reloads the first page and the &hilight part of the URL is empty.

I don't recall these things happening with the original search schema.
__________________
http://www.candidforums.com - Geeks ARE hot.
Reply With Quote
  #37  
Old 23 Apr 2003, 07:26
Da`Nacho Da`Nacho is offline
 
Join Date: Mar 2002
Gah it's driving me crazy... somehow spaces or something are being inserted in the query string, thats whats causing the screwups but I don't understand where it's coming from.

IE a normal one word search will end up having a + behind it... hard to explain.

If I remove the hack it's totally fine...

I got so frustrated that I totally reinstalled a clean copy of vBulletin 2.3.0 and reperformed the hack - same results.
__________________
http://www.candidforums.com - Geeks ARE hot.

Last edited by Da`Nacho; 23 Apr 2003 at 10:16.
Reply With Quote
  #38  
Old 23 Apr 2003, 23:31
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Real name: Brian
Just installed the hack and it seems to be working pretty good. Searches are much better, and posting does seem a little faster.

I can confirm Da`Nacho's problems though. It doesn't seem to highlight the words, and when you search for an exact phrase, the page numbers no longer work. It seems the link to page 2 (or any other) on showthread.php is somehow missing the "pagenumber=X" part of the url. After you search and go to the thread though, if you take out the "&highlight=xxxx" in the url and reload the page, it seems to work fine.
Other than that though it seems to work great.
__________________
Brian Gunter
vBadvanced
Reply With Quote
  #39  
Old 23 Apr 2003, 23:36
Da`Nacho Da`Nacho is offline
 
Join Date: Mar 2002
Today at 05:31 PM Tigga said this in Post #38
Just installed the hack and it seems to be working pretty good. Searches are much better, and posting does seem a little faster.

I can confirm Da`Nacho's problems though. It doesn't seem to highlight the words, and when you search for an exact phrase, the page numbers no longer work. It seems the link to page 2 (or any other) on showthread.php is somehow missing the "pagenumber=X" part of the url. After you search and go to the thread though, if you take out the "&highlight=xxxx" and reload the page, it seems to work fine.
Other than that though it seems to work great.

Yeah, I spent 5 hours last night redoing and redoing this hack and I just dont' know what the problem is. Anyone who wants to see what we mean can visit www.candidforums.com and use the search (it's enabled for guests).

We are running MySQL 4.0.12-0 and php 4.3.1 on Apache 1.3.27.

Anyone have any clues?
__________________
http://www.candidforums.com - Geeks ARE hot.
Reply With Quote
  #40  
Old 24 Apr 2003, 00:06
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Real name: Brian
Well I can tell you where the problem is coming from... After you perform a search, if you hold your mouse over the thread, you'll see it's linking to something like:
http://yoursite.com/forum/showthread.php?s=&threadid=x&highlight="what+you+searched+for"
The " marks in the url seem to be what's causing the problem. When you click on the thread it replaces the " marks with %2B in your browsers url. If you remove the %2B from the url then it seems to work as it should. Not sure how to fix it yet, but hopefully that gives traekwon a little more insight as to what the problem is.

I also just noticed another strange problem that seems to be coming from the %2B being in the url... After I performed the search and went to one of the threads, a smilie image there had border="0" alt=""> after the image. When I viewed the source there it has this for the html code...


<td bgcolor="#160056" colspan="2" align="left" valign="top"><p><font class="nf">he saw 'the ring'<br /><font color="red"></font>
<font color="red"></font><br /><font color="red"></font>
<font color="red"></font><img src="/forum/images/smilies/frown.gif"<font color="red"></font> border="0"<font color="red"></font> alt="<font color="red"></font>"><font color="red"></font></font></p></td>

Obviously it's trying to highlight quite a few things there that it shouldn't be.
__________________
Brian Gunter
vBadvanced
Reply With Quote
  #41  
Old 24 Apr 2003, 14:10
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Installed, and it works great.

This is a revolutionary hack for vB. I am quite sure future versions will incorporate this with it. Search is faster, posting is slightly faster (since we don't have to add to the searchindex and word tables)... 250 members online at once with no problems so far (I shall wait for my peak times) ...

As for the page and highlight errors - they don't apply to me since I don't use highlights as all my search result pages are parsed into a non-dynamic format like this:

http://www.yourdomain.com/search/137498-2.html

And it works great with this hack.

Thanks for this one.
Reply With Quote
  #42  
Old 26 Apr 2003, 09:25
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
I've managed to make my Search Thread hack work with this, which is great.

Very simple.

1) Install my search hack here first before installing this hack:

http://www.vbulletin.org/forum/showt...threadid=45142

If you've already installed my hack, that's fine. Go to next step.

2) Then, install this hack (after installing my hack first).

3) Then, find this block of code (which is from this hack) in search.php:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace with this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Alternative, if you've already installed this hack first, you can install my hack after, and skip PHP steps (1) and (2) in my instructions, and instead use Step (2) above, then follow the instructions (3)-(6) in my instructions.

Thanks, my Search Thread is much faster. I notice this new search is smarter and ignores common words too.

Last edited by Erwin; 26 Apr 2003 at 11:02.
Reply With Quote
  #43  
Old 26 Apr 2003, 09:30
Brad Brad is offline
 
Join Date: Nov 2001
Erwin, I was just thinking about that, thanks for the fix!
Reply With Quote
  #44  
Old 26 Apr 2003, 10:54
Da`Nacho Da`Nacho is offline
 
Join Date: Mar 2002
Today at 04:25 AM Erwin said this in Post #42
Alternative, if you've already installed this hack first, you can install my hack after, and skip PHP steps (1) and (2) in my instructions, and instead use Step (2) above, then follow the instructions (3)-(6) in my instructions.

Thanks, my Search Thread is much faster. I notice this new search is smarter and ignores common words too.

Erin, I get a parse error on line 402 when I try doing this hack...

line 402 just happens to be the following query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas?
__________________
http://www.candidforums.com - Geeks ARE hot.
Reply With Quote
  #45  
Old 26 Apr 2003, 11:03
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Oops! I made a mistake -

Change:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I left a comma there for some reason.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 12:17.

Layout Options | Width: Wide Color: