Oracle Text Reference Release 9.0.1 Part Number A90121-01 |
|
CONTAINS Query Operators, 8 of 28
Use the fuzzy operator to expand queries to include words that are spelled similarly to the specified term. This type of expansion is helpful for finding more accurate results when there are frequent misspellings in your document set.
The new fuzzy syntax enables you to rank the result set so that documents that contain words with high similarity to the query word are scored higher than documents with lower similarity. You can also limit the number of expanded terms.
Unlike stem expansion, the number of words generated by a fuzzy expansion depends on what is in the index. Results can vary significantly according to the contents of the index.
Oracle Text supports fuzzy definitions for English, German, Italian, Dutch, Spanish, and OCR.
If the fuzzy expansion returns a stopword, the stopword is not included in the query or highlighted by CTX_DOC.HIGHLIGHT or CTX_DOC.MARKUP.
If base-letter conversion is enabled for a text column and the query expression contains a fuzzy operator, Oracle operates on the base-letter form of the query.
fuzzy(term, score, numresults, weight)
Consider the CONTAINS query:
...CONTAINS(TEXT, 'fuzzy(government, 70, 6, weight)', 1) > 0;
This query expands to the first six fuzzy variations of government in the index that have a similarity score over 70.
In addition, documents in the result set are weighted according to their similarity to government. Documents containing words most similar to government receive the highest score.
You can skip unnecessary parameters using the appropriate number of commas. For example:
'fuzzy(government,,,weight)'
The old fuzzy syntax from previous releases is still supported. This syntax is as follows:
Parameter | Description |
---|---|
?term |
Expands term to include all terms with similar spellings as the specified term. |
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|