BadDog's mySQL Boolean Search Script

Download plugins, language packs and stuff.

BadDog's mySQL Boolean Search Script

Postby BadDog » Fri Dec 02, 2005 7:52 am

Here is a experimental release for anyone looking for a better search for mySQL. I wrote it this way so it will be compatable with mySQL 3.x. By default it searches for all of the words entered, will search by phrase using quotes. Will also accept NOT to exclude a word. Example: tony blair NOT bush will return all records with tony blair but not bush. I also have this search creating pagination with crude PREV <--> NEXT links.



Back up your current search.php and just replace it with this script and cross your fingers it works for you like it works for me under Windows and Linux.
Attachments
boolean_search3.zip
Third update to my boolean search script. Fixes a couple of bugs in the first.
(2.41 KiB) Downloaded 593 times
Last edited by BadDog on Fri Dec 02, 2005 10:59 pm, edited 4 times in total.
BadDog
 
Posts: 62
Joined: Mon Nov 21, 2005 8:19 am

Postby FI-DD » Fri Dec 02, 2005 10:37 am

Wow, I'm really impressed. That's fantastic. :D



It finds everything as promised.



A few bugs and suggestions:

1. I think you don't have to connect to the database in search.php. It's been already done in head.php.



2. It doesn't search in title of the news, I think.



3. You have to add the type-variable to the pagination link: &type=$_GET[type]

Otherwise the pagination breaks.



4. It took me a while to find out that it only works with "and, or, not" instead of "AND, OR, NOT" in contrast to your descriptions. :wink:



5. The result link doesn't work properly.

change this:

echo "<a href=\"?id=". $id . "\"><b>$sTitle</b></a><br>". $desc. "<p>\n";



to this:

echo "<a href=\"$config_http_home_url?id=". $id . "\"><b>$sTitle</b></a><br>". $desc. "<p>\n";
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby PJR » Fri Dec 02, 2005 10:44 am

It works.. But I'd welcome to use the Search template...
PJR
 
Posts: 165
Joined: Mon Oct 17, 2005 3:15 pm
Location: Czech republic

Postby BadDog » Fri Dec 02, 2005 5:43 pm

Yikes, found two more bugs that did not belong. OK, this second one looks stable and does the job. Plenty of framework for you all to improve on till my next work break were I can get time to fool with it some more to add things.
BadDog
 
Posts: 62
Joined: Mon Nov 21, 2005 8:19 am

Postby Syrion » Fri Feb 16, 2007 3:20 am

How can I use this script to show the output in another page? (searchresults.php for example?)
Image Mini-me
User avatar
Syrion
 
Posts: 185
Joined: Wed Aug 02, 2006 2:03 pm

Postby scottdallas » Fri Feb 16, 2007 10:49 pm

How can I use this script to show the output in another page? (searchresults.php for example?)




Let me take a look real quick. I know I've got it to work like that before.



Change:



Code: Select all
<form method="get" action="<?=$_SERVER['PHP_SELF']; ?>" align="center">




To:



Code: Select all
<form method="get" action="searchresults.php" align="center">




Or:



Code: Select all
<form method="get" action="../searchresults.php" align="center">




Depending on where you put searchresults.php.. Usually I have 'searchresults.php' in ../



By the way, I didn't test it and I can't remember... you might have to put searchresults.php? with the question mark on the end.. so try with searchresults.php and if that doesn't work, add a ?
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby rats » Sat May 12, 2007 4:45 pm

could this plugin be a little bit modified? you know... merge it with rufus and the quick tags?



my search results look pretty naaasteeeaaah! :oops:
rats
 
Posts: 44
Joined: Mon May 29, 2006 7:48 pm

Postby asson » Sat May 19, 2007 8:08 pm

Thanks for this great plugin.

Where does it get the template from after klicking the news?

When i Search and results are shown, after klicking on them it shows the news with a template that does not look like any template i'm using!



Regards
asson
 
Posts: 46
Joined: Fri Nov 24, 2006 2:15 am
Location: Karlstad, Sweden

Postby asson » Sat May 19, 2007 8:46 pm

I fixed it, thanks anyway.
asson
 
Posts: 46
Joined: Fri Nov 24, 2006 2:15 am
Location: Karlstad, Sweden

Postby scottdallas » Sat May 19, 2007 11:19 pm

What template does it use? This has been baffling me
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Disharmony » Fri Jun 13, 2008 9:41 am

How do I get the links to show up in RUFU?
Disharmony
 
Posts: 45
Joined: Thu Jun 05, 2008 12:45 pm

Postby flyboy17 » Sat Jun 14, 2008 11:02 pm

Nice job :D
It only search in the title en short story? Is there a way to search in the whole story also?
Thanks
flyboy17
 
Posts: 63
Joined: Wed Feb 21, 2007 4:32 pm

Postby FI-DD » Tue Jun 17, 2008 5:54 pm

User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby flyboy17 » Thu Jun 19, 2008 11:42 am

Works fine, thanks :)
flyboy17
 
Posts: 63
Joined: Wed Feb 21, 2007 4:32 pm

Postby Disharmony » Fri Jun 20, 2008 3:16 am

I replaced it with that one but when I punched in a keyword on the search box it just forwards me to my results page with the search form there and no results.
Disharmony
 
Posts: 45
Joined: Thu Jun 05, 2008 12:45 pm

Next

Return to Additional Downloads



Who is online

Users browsing this forum: No registered users and 0 guests

cron