This example searches a small wine database. Suggested searches: merlot or pinot (Boolean OR) or california and chardonnay (Boolean AND). Quotation marks can be used to create a search on an exact phrase. Try "a good bottle" for a phrase search.
For a second example, you can use the main site search for this Joe Dolson Accessible Web Design.
This search uses Boolean fulltext searching in MySQL. It works essentially the same way that Google does, with a few slight twists. For easily communicated instructions, a Boolean “AND” can be queried by placing the term “AND” between terms. A Boolean "OR" query can be structured similarly: with “OR” placed between terms.
The form accepts up to six unique terms using these systems. For more complex queries, MySQL's Boolean modifiers can be used. See my article Working with Boolean Queries in MySQL/PHP for an explanation of these modifiers.
The default search is a word search: each word of your query is searched independently, although if any exact match exists that will be sorted to the top (if you're using the default sort by relevancy). By placing quotes around your search phrase you can search the exact phrase (like in Google).
Simple Boolean Search Version 2.6 by Joe Dolson Accessible Web Design
« PHP/MySQL Database Search Home Page | Accessible Web Design Blog | Download
This work is licensed under a Creative Commons license with some rights reserved.