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.

Table 1. Advanced search operators and complex text search examples
Operators Examples Search results
AND
"King Lear" AND "Othello"
"King Lear" "Othello"
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
"King Lear" OR Lear 
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
"King Lear" 
NOT "Norman Lear" 
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:
"King Lear" 
Second text search:
"king"
The first text search returns the exact phrase King Lear.

The second text search returns only the word king and no other forms, such as kings or kingly.

*
(Wildcard character)
test* 
te*t
Returns documents that can match possible combinations, such as test, tests, and tester, or test and text.
?
(Wildcard character)
test? 
te?t
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:
"King Lear"^4 "Richard III"

Second text search:

title: (software download)^5
pdf viewer -shipping
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 software download to appear higher in the list of results.

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)
+Lear King
Returns all documents that contain Lear and King, which is the same as the text search Lear AND King.
-
(Excludes)
"King Lear" -"Lear Jet"
Returns documents that contain King Lear but not Lear Jet.
( )
(King OR Lear) AND plays
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)
\(1\+1\)\:2
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.