Skip to content

Filters

Sidhant Aggarwal edited this page Aug 3, 2020 · 1 revision

This parameter uses SQL-like syntax, where you can use boolean operators and parentheses to combine individual filters.

Textual Equality

Format: ${attributeName}:${value}

Example: name:john

Numeric Comparisons

Format: ${attributeName} ${operator} ${value}

Example: price > 12.99

The ${value} must be numeric. Supported operators are <, <=, =, !=, >= and >, with the same semantics as in virtually all programming languages.

Numeric Range

Format: ${attributeName}:${lowerBound} TO ${upperBound}

Example: price:5.99 TO 100

${lowerBound} and ${upperBound} must be numeric. Both are inclusive.

Boolean operators

Example:

price < 10 AND (category:Book OR NOT category:Ebook)

Individual filters can be combined via boolean operators. The following operators are supported:

  • OR: must match any of the combined conditions (disjunction)
  • AND: must match all of the combined conditions (conjunction)
  • NOT: negate a filter

Parentheses, ( and ), can be used for grouping.

You cannot negate a group of filters, only an individual filter. For example, NOT(filter1 OR filter2) is not allowed.