Operators
AND Operator
The operator and is used to search for documents in which all of the enumerated arguments are present (regardless their relative position and distance between them in the text).
Syntax
Example
OR Operator
The operator or is used to search for documents in which at least one of the enumerated query arguments is present.
Syntax
Example
Note
The or and and operators have equivalent functions orn and andn which are useful when dealing with a query consisting of several arguments, as it makes the expression more succinct.
XOR Operator
The xor operator is used to search for documents in which only one of the enumerated arguments is present.
Syntax
Example
NOT Operator
The operator not is used to search for documents in which the enumerated arguments are absent.
Syntax
Example
Task Example: Find texts about England that do not mention the United Kingdom or other parts of the United Kingdom
In order to exclude texts about Great Britain as a whole country and about other countries forming the United Kingdom users can prohibit the following words and phrases: "United Kingdom", "Great Britain", Scotland, Wales, "Northern Ireland":
Operator of Difference "/"
The operator "/" (and its equivalent functions difference() or except()) is used to search for documents which contain all of the occurrences of the first argument that do not intersect the occurrences of the second argument.
Syntax
Example
For more information, please see the section Excluding search results.
Operator of Intersection "&"
The operator "&" (and its equivalent functions intersect() and include()) is used to search for documents containing the occurrences of the first argument that intersect the occurrences of the second argument.
Syntax
Example
Task Example: Find companies whose activity is related to the United States
Users can write the following query to match companies whose name contains words and phrases "United States", "USA", "US" as well as "America" and its derivates (like "American"):
The Entity Extraction parent node should be executed for this query to work correctly. For more information, please see section "Entity Extraction Node".
Note
The functions include() and intersect() have some useful features the operator & does not have. For more information, please see the description of include() and intersect() functions.
Operators' Precedence
If a query contains several operators, the order of their performance depends on their precedence, i.e. operators with a higher precedence are performed first.
Operators and their respective precedence level are listed in the following table.
Operator |
Precedence |
& |
5 |
/ |
5 |
not |
4 |
xor |
3 |
and |
2 |
or |
1 |
If a query is made up of several operators with the same precedence level they are executed sequentially left to right.
Example
Users can alter the order of execution determined by operator precedence using parentheses. A subquery within parentheses is fully executed before the remainder of the query.
The order of operator’s execution may influence query results.
Example