Filters

The search requests accept an filter paramenter. You can us it construct complex filters using a simplified syntax.

Operatos

You can combine filter clauses using the following logical operators to create complex queries.

  • AND
  • OR
  • AND NOT

Parentheses can be used to group clauses in a filter query, which specifies the order in which they are executed.

For example:

is:active AND (category:"action" OR category:"horror") AND NOT stock:0

Let's explore the available filters with examples.

Not

To create a negative filter, you can prefix the filter value with NOT.

NOT {filter_clause}

Example:

NOT category:"action"

Equals

The equals syntax is used to filter for concrete values.

This operator is useful when you want to filter your search based on a particular field value.

{field}:"{value}"

Example:

category:"action"

Is

To filter is a boolean field is true use the is operator.

is:{field}

Example:

is:active

Is not

To filter is a boolean field is false use the is_not operator.

is_not:{field}

Example:

is_not:active

In

You can use the in operator if you need to filter for multiple values in a field.

{field}:[{value1}, {value2}]

Example:

category:["action", "horror"]

Range

You can accomplish filtering various ranges using the range operators >, <, <=, >=.

{field}{operator}{value}

Example:

stock>0

GEO Distance

You can filter on a Geo Point field like this

{field}:{distance}{unit}[{latitide},{longtitude}]

Example:

location:10km[51.49,13.77]