![background image](http://html1.mh-extra.com/html/oracle/5-0/5-0_reference-manual_1646196960.webp)
Full-Text Searches with Query Expansion
940
the same order. For example,
"test phrase"
matches
"test, phrase"
in MySQL 5.0.3, but not
before.
If the phrase contains no words that are in the index, the result is empty. For example, if all words
are either stopwords or shorter than the minimum length of indexed words, the result is empty.
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 ~macintosh'
Find rows that contain the word “apple”, but if the row also contains the word “macintosh”, rate it
lower than if row does not. This is “softer” than a search for
'+apple -macintosh'
, for which the
presence of “macintosh” causes the row not to be returned at all.
•
'+apple +(>turnover <strudel)'
Find rows that contain the words “apple” and “turnover”, or “apple” and “strudel” (in any order), but
rank “apple turnover” higher than “apple strudel”.
•
'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 quotation marks that enclose the search
string itself.
12.9.3. Full-Text Searches with Query Expansion
Full-text search supports query expansion (and in particular, its variant “blind query expansion”). This
is generally useful when a search phrase is too short, which often means that the user is relying on
implied knowledge that the full-text search engine lacks. For example, a user searching for “database”
may really mean that “MySQL”, “Oracle”, “DB2”, and “RDBMS” all are phrases that should match
“databases” and should be returned, too. This is implied knowledge.
Blind query expansion (also known as automatic relevance feedback) is enabled by adding
WITH
QUERY EXPANSION
following the search phrase. It works by performing the search twice, where the
search phrase for the second search is the original search phrase concatenated with the few most
highly relevant documents from the first search. Thus, if one of these documents contains the word
“databases” and the word “MySQL”, the second search finds the documents that contain the word
“MySQL” even if they do not contain the word “database”. The following example shows this difference:
mysql>
SELECT * FROM articles
->
WHERE MATCH (title,body) AGAINST ('database');
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...