Filtering Search Results

The filtering object (filters) is used to narrow search results based on specified criteria, such as categories, price ranges, dates, and other custom attributes. A common use case is to enable site visitors to filter search results using a set of options, also called “facets”. These are provided in a dedicated interface within the search listing page, and typically include filters like “categories”, “brand”, "arrival date", "price range" and other specific product attributes. The facets object is always returned in every search response if configured in Experience OS.

The filters object includes:

  • field (mandatory): The catalog column to filter by.
  • Values (mandatory): An array of values (OR condition will be applied between multiple values).
  • min/max (mandatory): Used for numerical fields, where "min" represents the "from" value and "max" represents the "to" value.

Example: Filter by price and brand

This example shows how you can enable users to filter search results by price and brand. The data is stored in the feed columns "price" and "brand" respectively, and a user can check the facet boxes on the results page to narrow down results, say, to show only products from Brand A or Brand B that are priced at over $100.

"filters": [ 
    { 
        "field": "brand", 
        "values": ["brandA", "brandB"] 
    }, 
    { 
        "field": "price", 
        "min": 100 
    } 
] 

Notes:

  • Filters are available for Visual Search and Semantic Search only.
  • Multiple filters are combined using AND condition.
  • Numeric filters (min/max) support only price, type:number, and type:date fields.
  • Maximum of 15 filters per query, each with up to 100 values.