| Author |
Message |
BadDog
Joined: 21 Nov 2005 Posts: 62
|
|
BadDog's mySQL Boolean Search Script |
|
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.
| 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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Wow, I'm really impressed. That's fantastic.
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.
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 |
|
 |
PJR
Joined: 17 Oct 2005 Posts: 161 Location: Czech republic |
|
|
|
It works.. But I'd welcome to use the Search template...
|
|
| Fri Dec 02, 2005 10:44 am |
|
 |
BadDog
Joined: 21 Nov 2005 Posts: 62
|
|
|
|
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 |
|
 |
Syrion

Joined: 02 Aug 2006 Posts: 172
|
|
|
|
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 |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1802 Location: US |
|
|
|
 |  | 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:
 |  | <form method="get" action="<?=$_SERVER['PHP_SELF']; ?>" align="center"> |
To:
 |  | <form method="get" action="searchresults.php" align="center"> |
Or:
 |  | <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
last update: 07-22-08: 8:30 pm |
|
| Fri Feb 16, 2007 10:49 pm |
|
 |
rats
Joined: 29 May 2006 Posts: 44
|
|
|
|
could this plugin be a little bit modified? you know... merge it with rufus and the quick tags?
my search results look pretty naaasteeeaaah! 
|
|
| Sat May 12, 2007 4:45 pm |
|
 |
asson
Joined: 24 Nov 2006 Posts: 46 Location: Karlstad, Sweden |
|
|
|
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 |
|
 |
asson
Joined: 24 Nov 2006 Posts: 46 Location: Karlstad, Sweden |
|
|
|
I fixed it, thanks anyway.
|
|
| Sat May 19, 2007 8:46 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1802 Location: US |
|
|
|
What template does it use? This has been baffling me
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Sat May 19, 2007 11:19 pm |
|
 |
Disharmony
Joined: 05 Jun 2008 Posts: 44
|
|
|
|
How do I get the links to show up in RUFU?
|
|
| Fri Jun 13, 2008 9:41 am |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
|
Nice job
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 |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
| Tue Jun 17, 2008 5:54 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
| Thu Jun 19, 2008 11:42 am |
|
 |
Disharmony
Joined: 05 Jun 2008 Posts: 44
|
|
|
|
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 |
|
 |
|