Product Search enables you to create storefront discovery experiences for your customers where they can browse and search across your Products.
15 000
per Product), Product Selections (up to 15 000
per Product), and Standalone Prices (up to 10 000
per Product).Those limits are soft, but if you go beyond the limits for Stores or Product Selections, the API will return non-deterministic results. For a large number of Standalone Prices, the API applies some sorting algorithm before returning a result.
Data integration
With application-side caches
If possible, use application-side caches to store the IDs and SKUs returned with the search results together with the corresponding product data.
With Product Projection API
product
GraphQL query with the returned Product IDs to retrieve the data you exactly require for your use case.With Product Projection parameters BETA
productProjection
field in the ProductSearchResult, provide the productProjectionParameters
field with the ProductSearchRequest.{}
to get the full ProductProjection included in the ProductSearchResult, or add query parameters according to your needs, for example {"priceCurrency": "USD"}
, to perform Product price selection on the returned ProductProjection.This integration option calls the Product Projection API and enriches the search result with the data returned by the API call. Because of this additional API call, the search request takes longer to respond to than a request without the parameters.
A best-effort caching approach is in place for this integration but there is no guarantee of freshness or ability to cache the product data.
Activation of the feature
mode: ProductsSearch
on the Update Project endpoint.{
"action": "changeProductSearchIndexingEnabled",
"enabled": true,
"mode": "ProductsSearch"
}
Automatic deactivation
Representations
ProductSearchRequest
query ​SearchQuery​ | The search query against searchable Product fields. |
sort ​Array of SearchSorting​ | Controls how results to your query are sorted.
If not provided, the results are sorted by relevance score in descending order. |
limit ​Int​ | The maximum number of search results to be returned in one page. Default: 20 ​Minimum: 0 ​Maximum: 100 ​ |
offset ​Int​ | The number of search results to be skipped in the response for pagination. Default: 0 ​Minimum: 0 ​Maximum: 10000 ​ |
markMatchingVariants ​Boolean​ | If query specifies an expression for a Product Variant field,
set this to true to get additional information for each returned Product about which Product Variants match the search query.
For details, see matching variants. |
productProjectionParameters ​BETA | Controls data integration with Product Projection parameters.
If not set, the result does not include the Product Projection. |
facets ​BETAArray of ProductSearchFacetExpression​ | Set this field to request facets. |
postFilter ​SearchQuery​ | Specify an additional filter on the result of the query after the API calculated facets .
This feature assists you in implementing faceted search. |
{
"query": {
"and": [
{
"fullText": {
"field": "name",
"language": "en",
"value": "banana"
}
},
{
"filter": [
{
"exact": {
"field": "variants.attributes.farming",
"fieldType": "text",
"value": "organic"
}
}
]
}
]
},
"sort": [
{
"field": "name",
"language": "en",
"order": "desc"
}
],
"limit": 10,
"offset": 0
}
ProductSearchProjectionParams BETA
expand ​Array of Expansion​ | Expands a value of type Reference in a ProductProjection.
In case the referenced object does not exist, the API returns the non-expanded reference. |
staged ​Boolean​ | Set to true to retrieve the staged Product Projection |
priceCurrency ​CurrencyCode​ | The currency used for Product price selection. Pattern: ^[A-Z]{3}$ ​ |
priceCountry ​CountryCode​ | The country used for Product price selection. It can be used only in conjunction with the Pattern: priceCurrency parameter.^[A-Z]{2}$ ​ |
priceCustomerGroup ​String​ | id of an existing CustomerGroup used for Product price selection. It can be used only in conjunction with the priceCurrency parameter. |
priceCustomerGroupAssignments ​BETAArray of String​ | IDs of existing CustomerGroups used for Product price selection, when using multiple Customer Groups. It can be used only in conjunction with the priceCurrency parameter. |
priceChannel ​String​ | id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter. |
localeProjection ​Array of Locale​ | Used for locale-based projection. |
storeProjection ​String​ | key of an existing Store.
If the Store has defined languages , countries , distributionChannels , or supplyChannels ,
they are used for projections based on locale, price,
and inventory.
For Projects with active Product Selections, the API does not take the availability of the Product in the specified Store into account.
Product Tailoring modifies the product information returned in API responses, but evaluating query expressions is restricted to the original product information. |
ProductSearchFacetExpression
ProductPagedSearchResponse
total ​Int​ | Total number of results matching the query. Minimum:Â0 ​ |
offset ​Int​ | Number of elements skipped. Minimum: 0 ​Maximum: 10000 ​ |
limit ​Int​ | Number of results requested. Minimum: 0 ​Maximum: 100 ​ |
facets ​BETAArray of ProductSearchFacetResult​ | Results for facets when requested. |
results ​Array of ProductSearchResult​ | Search result containing the Products matching the search query. |
ProductSearchResult
id ​String​ | id of the Product that matches the search query. |
matchingVariants ​ | Information about which Product Variants match the search query.
Only present if markMatchingVariants is set to true in the ProductSearchRequest. |
productProjection ​BETA | Projected data of the Product with id .
Only present if data integration with Product Projection parameters is requested. |
ProductSearchMatchingVariants
allMatched ​Boolean​ | true if all Variants of the returned Product match the search query, or if search query does not specify any expression for a Product Variant field.false if only a subset of the Product Variants match the search query.Is always false for query expressions on Product Variant fields. |
matchedVariants ​Array of ProductSearchMatchingVariantEntry​ | Identifiers of the Product Variants that match the search query. Empty if all Product Variants of the returned Product match. |
ProductSearchMatchingVariantEntry
id ​Int​ | id of the ProductVariant that matches the search query. |
sku ​String​ | sku of the ProductVariant that matches the search query. |
ProductSearchFacetResult
ProductSearchFacetResultCount
name ​String​ | Name of the facet. |
value ​Int​ | Number of Products (or Product Variants) matching the query. |
ProductSearchFacetResultBucket
name ​String​ | Name of the facet. |
buckets ​Array of ProductSearchFacetResultBucketEntry​ | Contains results of the facet. |
ProductSearchFacetResultBucketEntry
key ​String​ | Key of the bucket. |
count ​Int​ | Number of values in the bucket. |
Search Products
view_published_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/products/search -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"query" : {
"and" : [ {
"fullText" : {
"field" : "name",
"language" : "en",
"value" : "banana"
}
}, {
"filter" : [ {
"exact" : {
"field" : "variants.attributes.farming",
"fieldType" : "text",
"value" : "organic"
}
} ]
} ]
},
"sort" : [ {
"field" : "name",
"language" : "en",
"order" : "desc"
} ],
"limit" : 10,
"offset" : 0
}
DATA
{
"total": 148,
"offset": 0,
"limit": 10,
"facets": [
{
"name": "countProducts",
"buckets": [
{
"key": "white",
"count": 37
}
]
},
{
"name": "countVariants",
"buckets": [
{
"key": "white",
"count": 301
}
]
}
],
"results": [
{
"id": "8fde2af0-6a2f-4633-9ba4-83566f769a7f",
"matchingVariants": {
"allMatched": false,
"matchedVariants": [
{
"id": 1,
"sku": null
}
]
}
}
]
}
Searchable Product fields
field
property in simple expressions.
For standard fields on Products, the type of field determines which simple expressions are supported for the field.variants.*
fields contain the data for all Product Variants (including the Master Variant) for a Product.variants.prices.*
fields contain either Embedded Prices or Standalone Prices, depending on the Product's priceMode
.Attributes
variants.attributes.<attribute-name>
Boolean fields
Standard field | Query for |
---|---|
variants.availability.isOnStock | ProductVariants that are available in stock. |
Number and date fields
Standard field | Data type | Query for |
---|---|---|
reviewRatingStatistics.averageRating | double | Products with a certain average review rating. |
reviewRatingStatistics.highestRating | double | Products with a certain maximum in review rating. |
reviewRatingStatistics.lowestRating | double | Products with a certain minimum in review rating. |
reviewRatingStatistics.count | long | Products with a certain number of reviews. |
variants.prices.currentCentAmount | long | ProductVariants with a Price of certain cent amount taking the discounted price into account. |
variants.prices.centAmount | long | ProductVariants with a Price of certain cent amount not taking the discounted price into account. |
variants.availability.availableQuantity | long | ProductVariants with a certain available quantity. |
variants.prices.validFrom | dateTime | ProductVariants with a Price valid from a certain date and time. |
variants.prices.validUntil | dateTime | ProductVariants with a Price valid until a certain date and time. |
createdAt | dateTime | Products created at a certain date and time. |
lastModifiedAt | dateTime | Products last modified at any of its fields at a certain date and time. |
Keyword fields
Standard field | Query for |
---|---|
id | a Product with a specific id . |
key | a ProductVariant with a specific key . |
productType | a ProductVariant of a specific ProductType identified by its id . |
taxCategory | a ProductVariant with a specific TaxCategory identified by its id . |
state | a ProductVariant with a specific State identified by its id . |
categories | a ProductVariant that has a specific Category, identified by its id , assigned. A query for this field also returns Products that have more Categories assigned than the one specified. |
categoryOrderHints.{categoryID} | an entry in the Product's CategoryOrderHints identified by its Category id . |
categoriesSubTree | a ProductVariant that has a specific Category, identified by its id , or one of its subcategories assigned. |
variants.id | ProductVariants with a specific id . |
variants.key | a ProductVariant with a specific key . |
variants.sku | a ProductVariant with a specific sku . |
variants.prices.id | ProductVariants with a specific Price identified by its id . |
variants.prices.currencyCode | ProductVariants with prices for a specific currency formatted as CurrencyCode. |
variants.prices.country | ProductVariants with prices for a specific country formatted as CountryCode. |
variants.prices.customerGroup | ProductVariants with a Price for a specific CustomerGroup identified by its id . |
variants.prices.channel | ProductVariants with a Price for a specific Channel identified by its id . |
variants.availability.isOnStockForChannel | ProductVariants that are available in stock for a specific Channel identified by its id . |
variants.productSelections BETA | a Product Selection identified by its id that a Product Variant is assigned to. |
variants.stores BETA | a Store identified by its id that a Product Variant is available in. |
productSelections | a Product Selection identified by its id that a Product is assigned to. |
stores | a Store identified by its id that a Product is available in. |
Text and localized text fields
Standard field | Data type | Query for |
---|---|---|
name | localizedText | Products with a specific name for a specific Locale. |
slug | localizedText | a ProductVariant with a specific slug for a specific Locale. |
description | localizedText | Products with a specific description for a specific Locale. |
searchKeywords | localizedText | Products with specific searchKeywords for a specific Locale. |
Example query:
The following example demonstrates how to find Product Variants with a price of EUR 22.22:
{
"query": {
"and": [
{
"exact": {
"field": "variants.prices.currencyCode",
"value": "EUR"
}
},
{
"exact": {
"field": "variants.prices.centAmount",
"value": 2222
}
}
]
}
}
Matching variants
categories
, key
, slug
), all variants of the Products returned in the ProductSearchResult match the query expression by default.variants.attributes.*
, variants.prices.*
), the expression may match only for certain Product Variants.markMatchingVariants
to true
in the ProductSearchRequest.
This will cause the response to include the matchingVariants
field which contains the id
and sku
of the Product Variants that match the query. ...
{
"id": "{{ID-of-the-matching-Product}}",
"matchingVariants": {
"allMatched": false,
"matchedVariants": [
{
"id": 1,
"sku": "CSKW-093"
},
{
"id": 5,
"sku": "CSKP-0932"
},
{
"id": 8,
"sku": "CSKG-023"
}
]
}
},
...
matchingVariants
object with allMatched
set to true
, but it will not explicitly list all variants. ...
{
"id": "{{ID-of-the-matching-Product}}",
"matchingVariants": {
"allMatched": true,
"matchedVariants": []
}
},
...
not
expression, the API returns only the Products for which no Product Variant matches the nested simple expressions.commonSize
attribute set.
The following not-exists expression will return only Products for which none of the Product Variants have the commonSize
attribute set.
The API will not return Products that have at least one variant with this attribute.{
"query": {
"not": [
{
"exists": {
"field": "variants.attributes.commonSize.key",
"fieldType": "enum"
}
}
]
}
}
Query validation
Field levels
For query validation, the API organizes the indexed product information into three different levels:
Field level | Searchable Product fields | Rank |
---|---|---|
context level | stores , productSelections | 1 |
product level | all Product fields, for example key , name , productType , all Product Variant fields (variants.* ) except for prices | 2 |
price level | all price-related fields (variants.prices.* ) | 3 |
Validation of compound expressions
Query template
The following generic query template ensures compliance with the query validation:
"query": {
"and" | "or": [
<store criterion>,
<product-selection criterion>,
<product/variant criterion>,
<price criterion>
]
}
If your use case requires mixing field levels in compound expressions, you can still formulate valid queries if they follow the validation rules explained in the next section.
Validation logic details
The validation logic checks if all expressions in a compound expression can be combined successfully. When validating a compound expression, the verification is performed iteratively level by level in following order:
Consider following example compound expression in simplified syntax, highlighting the searchable fields and omitting the values.
and(
exact("stores", ...),
exact("productSelections", ...),
or(exact("variants.attributes.color", ...), fullText("description", ...)),
or(exact("variants.prices.country", ...), exact("variants.prices.channel", ...)),
exact("variants.prices.currencyCode", ...)
)
Valid compound expressions
- If both expressions are simple expressions on the same field level, the compound result is on single-level with the same rank as the simple expressions.
- If the expressions are simple expressions on different field levels, the compound result is marked as multi-level inheriting the rank of the lowest field level among its constituents.
- If one expression is multi-level and the other expression is single-level on the same level, the compound result is on the same multi-level.
- If one expression is multi-level and the other expression is single-level with a lower rank, the compound result is multi-level with the lowest rank among its constituents.
The rank of the multi-level expression must be higher or equal to the rank of the single-level expression.
Invalid compound expressions
- If one expression is multi-level and the other expression is single-level with a higher rank, the query is invalid and the API responds with an InvalidInput error.
- If both expressions are multi-level the query is invalid, regardless of the ranks, and the API responds with an InvalidInput error.
The error message lists the query expressions that failed the query validation. From the searchable fields listed in the error message, you can determine the level for each expression and analyze where it invalidates the query validation.
Expressions nesting level are incompatible:
expr1=
[ and(
exact("variants.prices.currencyCode", ...),
exact("variants.prices.channel", ...)
)
],
expr2=[
or(
and(
fullText("variants.parentProduct.name", ...),
exact("variants.parentProduct.productType", ...)
),
exact("variants.prices.country", ...)
)
]
Facets BETA
name
assigned to it, so it can be found in the ProductSearchFacetResult.Distinct facets
The distinct facet counts occurrences of distinct values.
ProductSearchFacetDistinctExpression
distinct ​ | Definition of the distinct facet. |
ProductSearchFacetDistinctValue
name ​String​ | Name of the distinct facet to appear in the ProductSearchFacetResultBucket. |
scope ​ | Whether the facet must consider only the Products resulting from the search ( Default: query ) or all the Products (all ).query ​ |
filter ​SearchQuery​ | Additional filtering expression to apply to the facet result before calculating the facet. |
level ​ | Specify whether to count Products ( Default: products ) or Product Variants (variants ).products ​ |
field ​String​ | The searchable Product field to facet on. |
includes ​Array of String​ | Specify which bucket keys the facets results should include. |
Define how the buckets are sorted. | |
limit ​Int​ | Maximum number of buckets to return. Default:Â10 ​Maximum: 200 ​ |
language ​Locale​ | String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example: DisplayName: en , en-US , zh-Hans-SG .Locale ​ |
fieldType ​ | If the field is not standard, this must be the Attribute type. |
missing ​String​ | Default value to use if the specified field is not present on some Products. |
Example:
size
. The response shows there are 112 Products of size 43
, 63 Products of size 44
, and 34 Products of size 45
.{
"facets": [
{
"distinct": {
"name": "sizes",
"field": "variants.attributes.size",
"fieldType": "number",
"limit": 50
}
}
]
}
{
"facets": {
"results": [
{
"name": "sizes",
"buckets": [
{
"key": "43",
"count": 112
},
{
"key": "44",
"count": 63
},
{
"key": "45",
"count": 34
}
]
}
]
}
}
Ranges facets
from
and to
. Open ranges can be specified by omitting either the from
or to
values.ProductSearchFacetRangesExpression
ranges ​ | Definition of the ranges facet. |
ProductSearchFacetRangesValue
name ​String​ | Name of the ranges facet to appear in the ProductSearchFacetResultBucket. |
scope ​ | Whether the facet must consider only the Products resulting from the search ( Default: query ) or all the Products (all ).query ​ |
filter ​SearchQuery​ | Additional filtering expression to apply to the facet result before calculating the facet. |
level ​ | Specify whether to count Products ( Default: products ) or Product Variants (variants ).products ​ |
field ​String​ | The searchable Product field to facet on. |
ranges ​Array of ProductSearchFacetRangesFacetRange​ | Define ranges for the facet. |
language ​Locale​ | String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example: DisplayName: en , en-US , zh-Hans-SG .Locale ​ |
fieldType ​ | If the field is not standard, this must be the Attribute type. |
ProductSearchFacetRangesFacetRange
key ​String​ | Key to assign the bucket. |
from ​Any​ | Starting value of the bucket (inclusive). |
to ​Any​ | Ending value of the bucket (non-inclusive). |
Example:
screenDiagonal
within a certain range. The response shows that there are 33 TVs with a screenDiagonal
lower than 40
, and 165 TVs with a screenDiagonal
between 40
and 55
.{
"facets": [
{
"ranges": {
"name": "screenDiagonalRanges",
"field": "variants.attributes.screenDiagonal",
"fieldType": "number",
"ranges": [
{
"to": 40
},
{
"from": 40,
"to": 55
},
{
"from": 55
}
]
}
}
]
}
{
"facets": {
"results": [
{
"name": "screenDiagonalRanges",
"buckets": [
{
"key": "*-40",
"count": 33
},
{
"key": "40-55",
"count": 165
},
{
"key": "55-*",
"count": 82
}
]
}
]
}
}
key
values in the response by including them in ranges
. The following example shows the ranges renamed to small
, medium
, and large
.{
"facets": [
{
"ranges": {
"name": "screenDiagonalRanges",
"field": "variants.attributes.screenDiagonal",
"fieldType": "number",
"ranges": [
{
"key": "small",
"to": 40
},
{
"key": "medium",
"from": 40,
"to": 55
},
{
"key": "large",
"from": 55
}
]
}
}
]
}
Count facets
The count facet counts the number of Products (or Product Variants).
ProductSearchFacetCountExpression
count ​ | Definition of the count facet. |
ProductSearchFacetCountValue
name ​String​ | Name of the count facet to appear in the ProductSearchFacetResultCount. |
scope ​ | Whether the facet must consider only the Products resulting from the search ( Default: query ) or all the Products (all ).query ​ |
filter ​SearchQuery​ | Additional filtering expression to apply to the facet result before calculating the facet. |
level ​ | Specify whether to count Products ( Default: products ) or Product Variants (variants ).products ​ |
ProductSearchFacetCountLevelEnum
products
The query should count Products.
variants
The query should count Product Variants.
Example:
200
Products and 1000
Product Variants).{
"facets": [
{
"count": {
"name": "all-products"
}
},
{
"count": {
"name": "all-variants",
"level": "variants"
}
}
]
}
{
"facets": {
"results": [
{
"name": "all-products",
"value": 200
},
{
"name": "all-variants",
"value": 1000
}
]
}
}
Operations on facets
You can modify facets with following operations to filter and sort them, for instance.
Select specific buckets key
includes
to specify which bucket keys the facet results should include.Example:
53992aac-cbbf-4b97-bb-09142435e1ea
and 344c8ceb-01ac-4d76-8f93-bbbc3d0edd5d
assigned.{
"facets": [
{
"distinct": {
"name": "categories",
"field": "categories",
"includes": [
"53992aac-cbbf-4b97-bb-09142435e1ea",
"344c8ceb-01ac-4d76-8f93-bbbc3d0edd5d"
]
}
}
]
}
{
"facets": {
"results": [
{
"name": "categories",
"buckets": [
{
"key": "53992aac-cbbf-4b97-bb-09142435e1ea",
"count": 243
},
{
"key": "344c8ceb-01ac-4d76-8f93-bbbc3d0edd5d",
"count": 12
}
]
}
]
}
}
Missing values
distinct.field
is optional, then all the Products without a value for this field will be ignored by default.missing
key and value. The value of missing
will be used as the key
for the count of Products without a value for distinct.field
.Example:
N/A
. All other keys represent the id
of a State, with the values specifying the count of Products in that State.{
"facets": [
{
"distinct": {
"name": "states",
"field": "state",
"missing": "N/A",
"limit": 50
}
}
]
}
{
"facets": {
"results": [
{
"name": "states",
"buckets": [
{
"key": "N/A",
"count": 112
},
{
"key": "995c735c-ad07-4d22-a35b-34e8f5238fd74",
"count": 63
},
{
"key": "fb77d7dc-94c5-45df-95bc-b8499286e4d55",
"count": 34
}
]
}
]
}
}
distinct.limit
Sort buckets in the facets results
sort
field allows sorting the bucket results in the facets results. You can sort buckets either by count
or key
and specify the order of the sort by asc
or desc
.ProductSearchFacetDistinctBucketSortExpression
Defines whether to sort by bucket count or key. | |
order ​ | Defines the sorting order. |
ProductSearchFacetDistinctBucketSortBy
count
Sort buckets by the count value.
key
Sort buckets by the bucket key.
Example:
key
in descending order.{
"facets": [
{
"distinct": {
"name": "attributes",
"field": "variants.attributes.name",
"sort": {
"by": "key",
"order": "desc"
}
}
}
]
}
{
"facets": {
"results": [
{
"name": "attributes",
"buckets": [
{
"key": "z-attribute",
"count": 1
},
{
"key": "b-attribute",
"count": 2
},
{
"key": "a-attribute",
"count": 1
}
]
}
]
}
}
Count entity for distinct and ranges facet
count
parameter of distinct and ranges facets.Example:
sizesByProducts
buckets will have a count of 10 (each Product has an item of each size) while the sizesByVariants
buckets will have a count of 50 (each Product Variant of a given size is counted). "facets": [
{
"distinct": {
"name": "sizesByProducts",
"fieldType": "number",
"field": "variants.attributes.size",
"count": "products"
}
},
{
"distinct": {
"name": "sizesByVariants",
"fieldType": "number",
"field": "variants.attributes.size",
"count": "variants"
}
}
]
Scope of facets
By default, all facets run in the scope of a query. That means if you query, for example, for Products that have been last modified before a certain date and in that same query you have a facet, this facet will only count Products that match the query.
global
facet and the filter
facet. You can combine both to accurately define the scope of your facets.ProductSearchFacetScopeEnum
all
Count all Products (or Product Variants) without considering the search query.
query
Only count the Products (or Product Variants) that match the search query.
Global facet
scope
to all
.Example:
In the following example, the "names" facet aggregates all Products, not only the ones with "butter" in their description.
{
"query": {
"fullText": {
"field": "description",
"value": "butter",
"language": "en"
}
},
"facets": [
{
"distinct": {
"scope": "all",
"name": "names",
"field": "name",
"language": "en",
"limit": 50
}
}
]
}
Filter facet
filter
facet.Example:
androidTabletOSVersions
is scoped only to Products that have the Attribute isTablet
set to true
.{
"query": {
"exact": {
"field": "variants.attributes.os",
"fieldType": "text",
"value": "Android"
}
},
"facets": [
{
"distinct": {
"name": "androidTabletOSVersions",
"field": "variants.attributes.osVersion",
"fieldType": "text",
"limit": 50,
"filter": {
"exact": {
"field": "variants.attributes.isTablet",
"fieldType": "boolean",
"value": true
}
}
}
}
]
}
Sorting
Sorting allows you to control how the results of your search query are sorted. If no sort is specified, the results are sorted by relevance score in descending order. Compound sorting (also known as multi-sort) is applied when you specify multiple sort expressions in order of priority, with each expression having its own sort direction. See the following example:
{
"sort": [
{
"field": "variants.prices.centAmount",
"order": "asc",
"mode": "min"
},
{
"field": "score",
"order": "desc"
}
]
}
{
"sort": [
{
"field": "categoryOrderHints.64daee6a-c0e1-42e5-b7a4-a597610b1218",
"order": "desc"
}
]
}
Pagination
10 000
results by requesting them page by page.
The total
field in a query result indicates how many results match the search query in total.Limit
limit
field allows you to set the maximum number of results returned on a page.
Any value between 0
and 100
is allowed, the default limit is 20
.Offset
offset
field allows you to control which page number you want to retrieve.
The default value is 0
, meaning you retrieve the first page of query results containing as many results as specified by limit
.
A value of 1
will skip the first page of results, and your result contains the second bucket of results with the specified limit
.9 900
and 10 000
depending on the limit
parameter.
That is, if you set the limit
parameter to its maximum value of 100
, the maximum offset
is 9 900
.
If you use the default page limit of 10
, you can set the maximum offset
value to 9 990
.10 000
results in total, a higher offset would exceed that limit.
In such a case, the API responds with an InvalidInput error with the message "Pagination cannot be used to fetch more than the first 10000 results."Product indexing
On average, Products are indexed every 15 minutes. Depending on the amount of data to update, the actual delay—until the product data is up-to-date—can be higher.
50
Attributes of each Product Variant, for which the AttributeDefinition's isSearchable
is set to true
, are indexed. The indexer follows the order of Attributes as defined on the corresponding Product Type.
This limit applies for each Product Variant individually, and only the Attributes present in the Product Variant are taken into account.
For example, if a Product Type has 75 Attributes defined, but only 42 of the Attributes are used on each Variant of the Product, all 42 Attributes are indexed for each of the Product Variants.Prices
priceMode
determines which Prices are indexed in the variants.prices
field.For the
Embedded
ProductPriceMode, the API indexes Embedded Prices; for Standalone
, the API indexes the Standalone Prices associated with the Product Variant.variants.prices
field for sorting, filtering, and faceting on Products, but its content is only retrievable through data integration with Product Projection parameters for Embedded Prices.
Standalone Prices cannot be retrieved through the Product Search API.10 000
.
For Products with Standalone Prices that exceed this limit, the system indexes a selection of the Prices as explained in the Large number of Standalone Prices section.currency
, country
, customerGroup
, and distributionChannel
) is actually indexed. Like other attributes, this process operates on an eventually consistent basis, meaning that invalid prices might still be present in the index immediately after an update. When trying later, the price will be updated.In case of multiple prices for the same scope, the one with the narrower (valid) time range is always selected over the price without time ranges.
price
field in the returned Product Projections is determined by price selection.Large number of Standalone Prices
10 000
Standalone Prices per Product.
In case you have Products with more Standalone Prices than that limit, the API applies the following sorting algorithm when indexing the Product Prices to achieve a fair distribution of indexed Prices across all Product Variants:For each Product in the Project:
- Calculate variant limit by dividing
10 000
by the number of Variants on the Product. - fetch Prices for all Variants.
- for each Variant:
-
sort Prices by
- currency (alphabetically by the
value.currencyCode
) - country (alphabetically, missing field is sorted as first)
- channel (alphabetically by
key
, missing field is sorted as first) - Customer Group (alphabetically by
key
, missing field is sorted as first)
- currency (alphabetically by the
-
truncate Prices that are beyond the variant limit
Prices with validity dates
By default, prices with validity dates are not supported. This means that prices are not automatically updated in the search index upon reaching a validity date.
Localized content
Language settings
languages
are set on the Project, the analyzers for the following languages are used by default: en
, en-GB
, en-CA
, en-US
, en-AU
, de
, de-DE
, es
, se
, fi
, da
, fr
, and fr-FR
.en
and de
, and a Product has localized name
fields, one for name.ro
and one for name.de
.
Since the Romanian language is not part of the Project language settings, the name.ro
field is not searchable, only the name.de
field is in this case.Supported languages
subtag | language |
---|---|
ar | Arabic |
ca | Catalan |
cs | Czech |
da | Danish |
de | German |
el | Greek |
en | English |
es | Spanish |
eu | Basque |
fa | Persian |
fi | Finnish |
fr | French |
hi | Hindi |
hu | Hungarian |
hy | Armenian |
id | Indonesian |
it | Italian |
ko | Korean |
lv | Latvian |
nl | Dutch |
no | Norwegian |
pl | Polish |
pt | Portuguese |
ro | Romanian |
ru | Russian |
sk | Slovak |
sv | Swedish |
th | Thai |
tr | Turkish |
zh | Chinese |