Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
BadDog's mySQL Boolean Search Script

 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
BadDog's mySQL Boolean Search Script
Author Message
BadDog



Joined: 21 Nov 2005
Posts: 62

Post BadDog's mySQL Boolean Search Script Reply with quote
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.



boolean_search3.zip
 Description:
Third update to my boolean search script. Fixes a couple of bugs in the first.

Download
 Filename:  boolean_search3.zip
 Filesize:  2.41 KB
 Downloaded:  438 Time(s)



Last edited by BadDog on Fri Dec 02, 2005 10:59 pm; edited 4 times in total
Fri Dec 02, 2005 7:52 am View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Wow, I'm really impressed. That's fantastic. Very Happy



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";
Fri Dec 02, 2005 10:37 am View user's profile Send private message
PJR



Joined: 17 Oct 2005
Posts: 161
Location: Czech republic

Post Reply with quote
It works.. But I'd welcome to use the Search template...
Fri Dec 02, 2005 10:44 am View user's profile Send private message
BadDog



Joined: 21 Nov 2005
Posts: 62

Post Reply with quote
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.
Fri Dec 02, 2005 5:43 pm View user's profile Send private message
Syrion



Joined: 02 Aug 2006
Posts: 172

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

_________________
Mini-me
Fri Feb 16, 2007 3:20 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1802
Location: US

Post Reply with quote
Quote:
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:
<form method="get" action="<?=$_SERVER['PHP_SELF']; ?>" align="center">




To:



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




Or:



Code:
<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 ?

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Feb 16, 2007 10:49 pm View user's profile Send private message Visit poster's website AIM Address
rats



Joined: 29 May 2006
Posts: 44

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



my search results look pretty naaasteeeaaah! Embarassed
Sat May 12, 2007 4:45 pm View user's profile Send private message
asson



Joined: 24 Nov 2006
Posts: 46
Location: Karlstad, Sweden

Post Reply with quote
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
Sat May 19, 2007 8:08 pm View user's profile Send private message
asson



Joined: 24 Nov 2006
Posts: 46
Location: Karlstad, Sweden

Post Reply with quote
I fixed it, thanks anyway.
Sat May 19, 2007 8:46 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1802
Location: US

Post Reply with quote
What template does it use? This has been baffling me

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Sat May 19, 2007 11:19 pm View user's profile Send private message Visit poster's website AIM Address
Disharmony



Joined: 05 Jun 2008
Posts: 44

Post Reply with quote
How do I get the links to show up in RUFU?
Fri Jun 13, 2008 9:41 am View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Nice job Very Happy
It only search in the title en short story? Is there a way to search in the whole story also?
Thanks
Sat Jun 14, 2008 11:02 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Try this:
http://forums.cutenewsru.com/search-for-multiple-words-t456.html
Tue Jun 17, 2008 5:54 pm View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Works fine, thanks Smile
Thu Jun 19, 2008 11:42 am View user's profile Send private message
Disharmony



Joined: 05 Jun 2008
Posts: 44

Post Reply with quote
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.
Fri Jun 20, 2008 3:16 am View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.