Oracle8i interMedia Text Reference Release 2 (8.1.6) Part Number A77063-01 |
|
Query Operators, 2 of 26
Operator precedence determines the order in which the components of a query expression are evaluated. Text query operators can be divided into two sets of operators that have their own order of evaluation. These two groups are described below as Group 1 and Group 2.
In all cases, query expressions are evaluated in order from left to right according to the precedence of their operators. Operators with higher precedence are applied first. Operators of equal precedence are applied in order of their appearance in the expression from left to right.
Within query expressions, the Group 1 operators have the following order of evaluation from highest precedence to lowest:
Within query expressions, the Group 2 operators have the following order of evaluation from highest to lowest:
Other operators not listed under Group 1 or Group 2 are procedural. These operators have no sense of precedence attached to them. They include the SQE and thesaurus operators.
In the first example, because AND has a higher precedence than OR, the query returns all documents that contain w1 and all documents that contain both w2 and w3.
In the second example, the query returns all documents that contain both w1 and w2 and all documents that contain w3.
In the third example, the fuzzy operator is first applied to w1, then the AND operator is applied to arguments w3 and w4, then the OR operator is applied to term w2 and the results of the AND operation, and finally, the score from the fuzzy operation on w1 is added to the score from the OR operation.
The fourth example shows that the equivalence operator has higher precedence than the AND operator.
The fifth example shows that the AND operator has lower precedence than the WITHIN operator.
Precedence is altered by grouping characters as follows:
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|