|
|
|
|
| |
Using FULLTEXT Searches
Versions of MySQL from 3.23.23 on include the capability for performing full text searches. The full text search engine allows you to look for words or phrases without using pattern-matching operations. This capability is enabled for a given table by creating a special kind of index and has the following characteristics:
Full text searches are based on FULLTEXT indexes, which may be created only for MyISAM tables, and only for TEXT columns and non-BINARY CHAR and VARCHAR columns.
FULLTEXT searches are not case sensitive. This follows as a consequence of the column types for which FULLTEXT indexes may be used.
Common words are ignored for FULLTEXT searches, where "common" means "present in at least half the records." It's especially important to remember this when you're setting up a test table to experiment with the FULLTEXT capability. (Be sure to insert at least three records into your test table. If the table has just one or two records, every word in it will occur at least 50 percent of the time and you'll never get any results!) Certain very common words, such as "the," "after," and "other," are stop words that are always ignored. Words that are too short also are ignored. By default, "too short" is defined as less than four characters, but with a recent enough server may be set lower.
Words are defined as sequences of characters that include letters, digits, apostrophes, and underscores. This means that a string like "full-blooded" is considered to contain two words—"full" and "blooded." Normally, a full text search matches whole words, not partial words, and the FULLTEXT engine considers a record to match a search string if it includes any of the words in the search string. A variant form of search called a boolean full text search allows you to impose the additional constraint that all the words must be present (either in any order, or, to perform a phrase search, in exactly the order listed in the search string). With a boolean search, it's also possible to match records that do not include certain words or to add a wildcard modifier to match all words that begin with a given prefix.
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|