Boolean Operators are used to connect and define the relationship between your search terms. When searching, you can use Boolean operators to either narrow or broaden your record sets. The three Boolean operators are AND, OR and NOT.
Operator |
Explanation |
AND |
Searches for results that include both the term before and the term after the operator. For example: the query |
OR |
Searches for results that include either the term before or the term after the operator (or both). For example: the query |
NOT |
Searches for results that do not include the term after the operator. For example the query |
Case sensitive: the Boolean operators (AND, OR, NOT) are only recognized if written in uppercase. This behavior is intended to avoid problems when searching for records such as with the title "The Fox and The Crow".
The search engine combines operator sequentially. Below are two examples to help understand the logic of combining operators.
Example 1: the query Einstein AND Physics OR Universe
is equivalent to doing two queries:
Query 1: Einstein AND Physics
Query 2: Universe
If a record has metadata that satisfies one of the above queries, it will show in the results list.
Example 2: the query Physics OR Universe AND Einstein
is equivalent to doing two queries:
Query 1: Physics AND Einstein
Query 2: Universe AND Einstein
If a record has metadata that satisfies one of the above queries, it will show in the results list.
Building queries within an index: when searching for e.g. multiple subjects or collections, the following syntax must be applied: subject:"Engineering" AND subject:"Physics"
. This query retrieves records with at least one subject containing the word engineering and at least one containing the word physics, as well as records with both terms appearing in a single subject. Please note that the following syntax would NOT provide you with results that have both subjects. rather, it would look for records that have a single subject called "Engineering Physics": subject:"Engineering AND Physics"
.