Filtering

Filter your results

circle-info

Filtering is similar to facets selection, since the results will be filtered based upon selected facets AND filters. However, with filters, you don't have access to results grouping, list and count of the values, ...

Filters can be applied to any attribute in the catalog

Parameters

Filtering the results is controlled by the filter parameter. This parameter expects a SQL-like formatted string that describes the filtering rules.

Check below for more info.

Name

Type

Is Required ?

Default value

filter

string

βœ–

empty string

filter

Filter the results using an SQL-like syntax. The generic syntax is as follows:

filterRule: `${attribute} ${rule_operator} ${value}`

filterGroup: `(${filterRule1} ${group_operator} ${filterRule2} ...)`

rule_operator: =, !=, <, <=, >, >= 
group_operator: AND, OR

filter can be either a single filterRule or a filterGroup.

  • For example, all the following filters are valid:

Response

All responses from XO Search uses the same format. Check API Reference page for a more detailed description of this format.

API Referencechevron-right

Usage examples

  • Filter results with a price higher than 10 €

NodeJS / NPM example

HTML example

Last updated