Search Filters
This section explains how the filter object works and how you can use it to define a number of applied fields to your query to search an item by a search term, type, etc.
In order to perform these operations, ensure that you have the proper authentication (if necessary) and user permissions.
Filter using Search Term
To filter the search results using a specific search term, the searchTerm field is used. It takes a string value, which is the term you would like to use to filter the results. Below, the query is getting all the results that are associated with the term 'plant'.
Fetching snippet...
Filter by Type
Fetching snippet...
Include
The include field allows you to filter results via the following fields: id, variants, topics, paths, shapes, SKUs, etc. The query below fetches all the products within a specified path.
Fetching snippet...
Exclude
The exclude field does the exact opposite, it excludes items. The example query below retrieves all the items in the plants folder, but excludes the product whose ID we have specified. You can specify multiple IDs within the array.
Fetching snippet...
Product Variants
You can filter results based on whether it's a variant or not. Using the product variants field, you can also further filter the results belonging to a price range or filter these via attributes. The following query returns items that are not the default variants.
Fetching snippet...
Price Variants
If you have multiple price variants, you can retrieve a specific variant by using the priceVariants field. All you need to do is specify the identifier.
Fetching snippet...