Just a quick announcement that I’ve updated my search script for Boolean matching in MySQL. The latest version is available for download on the PHP (Hypertext PreProcessing)/MYSQL Search Engine script page.
The changes to this version include:
Fixed: various minor bugs
Fixed: multipage results not available with quoted strings
Fixed: full-text query problem
Fixed: some compatibility issues with different PHP/MySQL configurations.
Added: sortable results
Added: configurable field label names
Added: sample results page
Added: test mode for troubleshooting.
It’s not a massive update; but the script should be easier to use and more reliable.
11 Comments on “PHP/MySQL Boolean Search Script Updated”
Manage Cookie Consent
This site (joedolson.com) uses technologies like cookies to store and/or access device information. Not consenting or withdrawing consent may adversely affect some features.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Joe Dolson; November 9, 2008 at 8:56 pm
@robson – Hi! I’ve been out of town for the last few days, but I’ll take a look when I get a chance.
@olli – I appreciate your comments, but you’re addressing them to the wrong person. That’s the way the * operator was designed in MySQL: it operates as a terminal wildcard, not an initial wildcard. More about Boolean queries in MySQL.
olli; November 9, 2008 at 1:17 pm
nice Script, but “*enwood” returns no results (Kenwood)… 🙁
Robson; November 5, 2008 at 12:30 pm
Sorry to bother you again, man, but I’m havin a little problem with the script and maybe you can help me.
On saturday, I made my company’s most recent project public. Its a search engine where people can find the whole content of the local phone book online.
The problem I’m having is that I’m not finding some things that I know that are in the DB. I dont know if it’s my mistake or it’s not a mistake at all.
The only modifications I made to your original script were: I made it OO to suit the rest of the project, I made every query start with a + when no operator is used and I put an * in every query. Its all on http://www.bqbuscas.com.br
I hope u can help me and sorry, again, to bother u.
Thanks in advance
Joe Dolson; October 7, 2008 at 9:31 am
Thanks, Robson. The only way I know to use wildcards at the beginning of your query string is by using regular expressions — and (although I’m not 100% sure,) I don’t think you can combine regular expressions with the fulltext search expressions.
What you could do is add a regular expression mode option to the script such that a person can elect to do a search providing only the end of the word, and it would run the search using the separate select statement with a regular expression — but, sadly, the fulltext options simply don’t include a stemming selector. Maybe someday…
Robson; October 6, 2008 at 9:04 pm
Thank you very much for the script, Joe. I’ve been using it since version 1.5 and I’m always glad to find out the great enhancements you always make to it.
I really need to use a wildcard both in the beginning and in the end of the query string. I’ve searched extensively to find out a way to accomplish it but I’m still clueless. Is there a way or a workaround I can implement in order to get to it?? Sorry to bother. And thank you very much again.
Joe Dolson; August 11, 2008 at 2:26 pm
Thanks, Alen! Look forward to hearing from you after you’ve finished things up.
Alen; August 11, 2008 at 10:27 am
I just found your script googling out to find a nice php script to run on my website.
after trying your demo i got a GREAT impression about it! Bravo!
After putting it in production i will let you know!
Joe Dolson; June 19, 2008 at 12:18 pm
In fact, it does support the “*” wildcard operator. It’s only available as a final wildcard, but you can enter “cur*” to perform a search for terms beginning with “cur.” (Curtain, curtail, current, etc.)
I think that this is documented in the script somewhere, although I’ll be honest that I don’t recall the details right now…
I appreciate the comment, however, and I’ll make a point of adding that to the documentation as soon as possible!
Susan; June 19, 2008 at 8:52 am
Thanks for this lovely site and this utility. I wonder, is there a reason why it searches for whole words only? We have a small database but there are some technical terms which are difficult to spell. Is it possible for users to add an * or something if they want a truncated value?
Joe Dolson; October 23, 2007 at 9:40 am
Certainly worth noting. I can’t honestly say that PHP (Hypertext PreProcessing) 6 is at the front of my thoughts right now — given how long it takes for these things to move into production environments. However, since
pregfunctions are available now, I might as well make the switch!
Mike Cherim; October 23, 2007 at 8:25 am
Nice job Joe. I do want to note one thing: The
eregi()functions will no longer be supported with PHP6 so you might want to replace that with
preg_match()in the next build.