Search Help

Using the Basic Operators: AND, OR, NOT, +, -, and !

  • You must use operators AND, OR, NOT in uppercase.
  • Operators +, -, ! may be used in place of AND, NOT
  • The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used.
  • Use parentheses to clarify the search. Terms enclosed in parentheses are evaluated first; innermost parentheses are evaluated first when there are nested parentheses.
Examples: AND, OR, NOT
Search terms
Returns records that contain:
"consumer credit"
the phrase "consumer credit"
consumer AND credit
+consumer +credit
both consumer and credit, not necessarily next to each other
consumer OR credit
consumer credit
records containing either term
consumer NOT credit
consumer -credit
consumer !credit
records containing consumer but not credit
finance OR (consumer AND credit)
finance, or the combination of consumer and credit
(finance OR consumer) AND credit
either finance or consumer, and credit
"consumer credit" AND penalties NOT criminal
phrase "consumer credit" and penalties but not criminal

Stemming

By default, Solr searches for stemmed variations of the words you search for. A search for meet returns meets and meeting.

Use of Quotation Marks

When you put a search term in quotation marks, Solr will still use the STEM operator. For example, a search for "consumer finance subsidiary", enclosed in quotation marks, will return results containing "consumer finance subsidiaries."

Searching with Wildcards

?
Matches any single alphanumeric character.
Example: apple?
Returns: apples or applet
*
Matches zero or more alphanumeric characters.
Example: app*ed
Returns: Appleseed, applied, appropriated, and so on

Escaping Special Characters

Solr gives the following characters special meaning when they appear in a query:

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \

To make Solr interpret any of these characters literally, rather as a special character, precede the character with a backslash character \. For example, to search for (1+1):2 without having Solr interpret the plus sign and parentheses as special characters for formulating a subquery with two terms, escape the characters by preceding each one with a backslash:

\(1\+1\)\:2

Proximity Operators

A proximity search looks for terms that are within a specific distance from one another. To perform a proximity search, add the tilde character ~ and a numeric value to the end of a search phrase. For example, to search for a "assignment" and "transactions" within 5 words of each other in a document, use the search:

"assignment transactions"~5

The distance referred to here is the number of term movements needed to match the specified phrase. In the example above, if "assignment" and "transactions" were 5 spaces apart in a field, but "transactions" appeared before "assignment", more than 5 term movements would be required to move the terms together and position "transactions" to the right of "assignment" with a space in between.