Nested Queries allows you to build a query that references other queries to build a more comprehensive query string.
How they work
In order to reference an existing query, place * in front of name of the query you wish to reference. For example, consider the following query strings:
|Dirty||dirty OR filth* OR disgust* OR nasty|
|Bathroom||bathroom* OR toilet* OR restroom* OR lavator*|
|Restaurant_Interior||restaurant OR table* OR chair* OR carpet* OR furniture* OR plate* OR cup* OR glass*|
If you want to build a query to find mentions of a dirty washroom, you can build nest two of the above queries into one query as followed:
|Dirty Bathroom||(*Dirty) AND (*Bathroom)|
This essentially means that a piece of content that contains mention of the words dirty, filthy, disgusting, or nasty, while also containing mention of the words bathroom, toilet, restroom, or lavatory.
A more complex example for nested queries is as follows:
|Dirty Restaurant Interior||(*Dirty) AND ((*Bathroom) OR (*Restaurant_Interior))|
Here, a comment will be tagged as "Dirty Restaurant Interior" if any of the words that fit the criteria in the "Dirty" query are present along side any words that meet the criteria of either the "Bathroom" or "Restaurant_Interior" queries.
In order for nested queries to work properly, the following must be taken into consideration:
- All queries being nested must have names that DO NOT contain spaces.
Meaning a query with a name "Restaurant Interior" is invalid; however, "Restaurant_Interior" is valid.
- All queries being nested should be wrapped in parentheses to maintain proper query logic.
Meaning that (*Dirty) is valid; however, *Dirty is invalid.
- Only AND and OR operators are supported in building nested query logic.
Meaning other operators like NOT, NEAR5, and EXCLUDE are not valid.