Advanced text search operators
You can use advanced text search operators to refine the search results for the CONTAINS function and the SCORE function.
In the following table, the first column describes the operator that you can use in a text search. (You must enter the logical operators NOT, AND, and OR in all uppercase letters.) The second column shows a sample text search that you might enter. The third column describes the types of results that you might see from the example text search.
Operators | Examples | Search results |
---|---|---|
AND |
|
Either text search returns documents that contain both
terms King Lear and Othello . The AND operator
is the default conjunction operator. If no logical operator is between the
two terms, the AND operator is used. For example, the text search King
Lear is the same as the text search King AND Lear . |
OR |
|
Returns documents that contain either King Lear or
just Lear . The OR operator links the two terms and finds
a matching document if either of the terms exist in a document. |
NOT |
|
Returns documents that contain King Lear but
not Norman Lear . The NOT operator cannot be used with only
one term. For example, the following search will return no results: NOT
"King Lear" . |
" " (Exact match)
|
First text search:
Second text search:
|
The first text search returns the exact phrase King
Lear . The second text search returns only the word |
* (Wildcard character)
|
|
Returns documents that can match possible combinations,
such as test , tests , and tester ,
or test and text . |
? (Wildcard character)
|
|
Returns documents that can match possible combinations,
such as tests , or test and text . |
^ (Score boost factor)
some word or phrase^number
|
First text search:
Second text search:
|
The first text search forces documents with the phrase King
Lear to appear higher in the list of search results.The second
text search forces a document titled Although a boost factor must be positive, the boost factor can be less than 1. For example, 0.2. The boost factor number has no limit. |
+ (Includes)
|
|
Returns all documents that contain Lear and King ,
which is the same as the text search Lear AND King . |
- (Excludes)
|
|
Returns documents that contain King Lear but
not Lear Jet . |
( ) |
|
Returns documents that contain either King or Lear and plays .
The parentheses ensure that plays is found and either term King or Lear is
present. |
\ (Escape character)
|
|
Returns documents that contain (1+1):2 .
Use the \ to clear special characters that are part of the text search syntax.
Special characters are + - && || ! ( ) { } [ ] ^ " * ? : \. If a special
character is cleared, the special character is analyzed as part of the text
search. |