images/contents.gifimages/index.gif

Nested Query Elements

If one of the member elements within a compound query element is itself a compound query element, then we refer to that member element as a nested query element. Although it was not identified as such, we have already seen such a case. Consider again the last example, only we will add parentheses to mark the explicit grouping for OP1:

(q1 OP1 (q2 OP2 q3))

The compound query element, (q2 OP2 q3), is nested inside the compound query element built around OP1. This kind of nesting in a search query can be several levels deep, if needed. The group formed by OP2 would be evaluated first, and its result would then be used to finish the evaluation of the group formed by OP1.