The following examples demonstrate some search strings that use boolean full-text operators:
- 'gala apple'
- Find data that contain at least one of the two words, "gala" or "apple".
- '+apple +juice'
- Find data that contain both words ("+" means must find the following word).
- '+jonagold macintosh'
- Find data that contain the word “jonagold”, but rank data higher if they also contain “macintosh”.
- '+cortland -macintosh'
- Find data that contain the word “cortland” but not “macintosh”.
- '+macoun ~macintosh'
- Find data that contain the word “macoun”, but if the line of data also contains the word “macintosh”, rate it lower than if line does not. This is “softer” than a search for '+apple -macintosh', for which the presence of “macintosh” causes the line not to be returned at all.
- '+apple +(>cider <donut)'
- Find data that contain the words “apple” and “cider”, or “apple” and “donut” (in any order), but rank “apple cider” higher than “apple donut”.
- Find data that contain words such as “apple”, “apples”, “applesauce”, or “applet”.
- '"apple cider"'
- Find data that contain the exact phrase “apple cider” (for example, data that contain “apple cider donuts” but not “apple cider and donuts”). Note that the ‘"’ characters that enclose the phrase are operator characters that delimit the phrase. They are not the quotes that enclose the search string itself.
adapted from the MySQL manual at http://dev.mysql.com/