TGPX takes advantage of MySQL's fulltext search functions to provide you with powerful boolean mode search features. This will allow you to search for matches on any words of a phrase, all words of a phrase, an exact phrase, and much more. However, this type of search is only available for certain database fields, and will not work with all of the search functions. Throughout the TGPX manual you will find information on which fields and functions support boolean mode searches.
Boolean Search Overview
For fields that support boolean mode searches, the search type dropdown selection box (matches, contains, starts with, etc) will have no effect. The search will be done based on the search term and operators that you enter in the search field as described below.
Some words are ignored in boolean mode searches:
- Any word that is too short is ignored. The default minimum length of words that are found by boolean mode searches is four characters.
- Words in the stopword list are ignored. A stopword is a word such as the or some that is so common that it is considered to have zero semantic value.
-
+
A leading plus sign indicates that this word must be present in each row that is returned.
-
-
A leading minus sign indicates that this word must not be present in any of the rows that are returned.
Note: The
-
operator acts only to exclude rows that are otherwise matched by other search terms. Thus, a boolean-mode search that contains only terms preceded by-
returns an empty result. It does not return all rows except those containing any of the excluded terms. -
(no operator)
By default (when neither
+
nor-
is specified) the word is optional, but the rows that contain it are rated higher. -
*
The asterisk serves as the truncation (or wildcard) operator. Unlike the other operators, it should be appended to the word to be affected. Words match if they begin with the word preceding the
*
operator. -
"
A phrase that is enclosed within double quote (
"
) characters matches only rows that contain the phrase literally, as it was typed.
The following examples demonstrate some search strings that use boolean full-text operators:
-
apple banana
Find rows that contain at least one of the two words.
-
+apple +juice
Find rows that contain both words.
-
+apple macintosh
Find rows that contain the word apple, but rank rows higher if they also contain macintosh.
-
+apple -macintosh
Find rows that contain the word apple but not macintosh.
-
apple*
Find rows that contain words such as apple, apples, applesauce, or applet.
-
"some words"
Find rows that contain the exact phrase some words (for example, rows that contain some words of wisdom but not some noise words). 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.