The query-level syntax supports prefix-oriented Boolean functions (AND, OR, and NOT), colon-separated paths for dimension values and property values, and numeric dimension value IDs.
The following BNF grammar describes the syntax for query-level filter expressions:
<filter> ::= <and-expr> | <or-expr> | <not-expr> | <filter-expr> | <literal> <and-expr> ::= AND(<filter-list>) <or-expr> ::= OR(<filter-list>) <not-expr> ::= NOT(<filter>) <filter-expr> ::= FILTER(<string>) <filter-list> ::= <filter> | <filter>,<filter-list> <literal> ::= <pval> | <dval-id> | <dval-path> <pval> ::= <prop-key>:<prop-value> <prop-key> ::= <string> <prop-value> ::= <string> <dval-path> ::= <string> | <string>:<dval-path> <dval-id> ::= <unsigned-int> <string> ::= any character string
The following five special reserved characters must be prepended with an escape character (\) for inclusion in a string:
( ) , : \
Aside from nested Boolean operations, a key aspect of query filter expressions is the ability to refer to file-based filter expressions using the FILTER operator. For example, if a filter is stored in a file called MyFilter, that filter can be selected as follows:
FILTER(MyFilter)
FILTER operators can be combined with normal Boolean operators to compose filter operations, as in this example:
AND(FILTER(MyFilter),NOT(Manufacturer:Sony))
The expression selects records that are satisfied by the expression contained in the file MyFilter but that are not assigned the value Sony to the Manufacturer property.