Search allows you to filter your catalogue based on a very generic term e.g. “teddy bear”, up to a very detailed query that combines name, paths and even tagged topics.
The Filter Object
The filter object allows you to define a number of applied fields to your query and search an item by:
searchTerm: Matching term items will be returned as results
type: Specific type (Product, Document, Folder) items will be returned as results
include: Objects that satisfy the requirements (e.g. implement a specific topic, are under path, etc.) will be returned as results
exclude: Objects that satisfy the requirements (e.g. implement a specific topic, are under path, etc.) will not be returned as results
productVariants: Apply filters on variant level, e.g. price Range, attribute based search
Applying filters to a search query
Get the product default Variant
The Search API indexes products at variant level, that leads to having multiple instances of the same product in a search result, if our search query is generic. To avoid having the API return multiple instances of the same result, you can request only the default variant as a filter to your query.