Search settings turn storefront search and predictive search on or off and choose the result types search returns. They apply to every storefront in the store. Reads require read_search; changes require write_search. Send back the revision you read when you update, so a change made in the meantime is never overwritten.
The search index follows product, collection, page and other edits on its own. Rebuilding it re-indexes every searchable resource in every store language in the background; storefront search keeps answering from the current index while it runs, and only one rebuild runs at a time. Follow a rebuild with its job. Synonyms are managed under Search synonyms.
Endpoints#
Get search settings
Get the store's storefront search settings.
Returns whether storefront search and predictive search are on, the result types search returns, and revision: send it back when you update. options.result_types lists every selectable result type.
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
Update search settings
Change the store's storefront search settings.
Send revision from Get search settings and at least one setting; omitted settings stay unchanged. search_result_types replaces the whole list; repeats count once. A save that changes nothing returns the current settings. A change made since revision was read returns SEARCH_SETTINGS_CHANGED_DURING_EDIT: read the settings again before saving.
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Body parameters
| Name | Type | Description |
|---|---|---|
revision
required
|
string |
|
search_enabled
|
boolean |
Turn storefront search on or off. |
predictive_search_enabled
|
boolean |
Show suggestions while shoppers type. |
search_result_types
|
array<string> |
Result types storefront search returns, in any order.
Allowed values
productscollectionscategoriesvendorsbrandspagesblog_postsblog_categoriespolicies |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
-
400STORE_API_INVALID_REQUEST_BODYThe body has an unknown field or a field has the wrong type.
-
400SEARCH_SETTINGS_REVISION_REQUIREDrevision is missing.
-
400INVALID_INPUTNo setting was sent.
-
400STOREFRONT_SEARCH_RESULT_TYPE_INVALIDA result type is not one of options.result_types.
-
409SEARCH_SETTINGS_CHANGED_DURING_EDITThe settings changed since revision was read.
-
400STORE_API_BODY_PROPERTY_UNKNOWNThe body has a property this request does not accept. The message and
error.details.propertieslist the allowed and required properties (nestedfor each object or list of objects). -
400STORE_API_BODY_PROPERTY_INVALIDA body property has the wrong type (
error.details.expected_type). The message anderror.details.propertieslist the allowed and required properties.
Rebuild the search index
Rebuild the store's storefront search index.
Starts a background rebuild of every searchable resource in every store language and returns its job_id. Storefront search keeps answering from the current index while it runs. Only one rebuild runs at a time, and a store can start one rebuild per hour; follow it with Get a search index rebuild. A rebuild rewrites only documents whose content changed and removes documents for resources no longer shown. Product, page and other edits already reach the index on their own; a rebuild is for repairing it.
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
-
409SEARCH_REINDEX_IN_PROGRESSA rebuild is already running.
-
429SEARCH_REINDEX_COOLDOWNA rebuild started less than an hour ago; the message says how many minutes remain.
Search index rebuild limits
Get the rebuild list page sizes.
jobs_list_page_size is the default limit; jobs_list_max_limit is the largest accepted.
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
List search index rebuilds
List the store's search index rebuilds, newest first.
Finished rebuilds are kept for a limited time. Each rebuild carries status_display, its status named in the request language (English by default). A failed rebuild carries failure_message with a support reference. completed_types of total_types resource types are done; document_count is the number of documents indexed so far.
Query parameters
| Name | Type | Description |
|---|---|---|
limit
|
integer |
Page size, up to jobs_list_max_limit. |
offset
|
integer |
Number of rebuilds to skip. |
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
Get the running search index rebuild
Get the rebuild that is running now.
job is null when no rebuild is running.
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
Get a search index rebuild
Get one search index rebuild.
status is processing, completed or failed; status_display names it in the request language (English by default).
Path parameters
| Name | Type | Description |
|---|---|---|
job_id
required
|
uuid |
Rebuild job id from Rebuild the search index or List search index rebuilds. |
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
401UNAUTHORIZEDAuthorization header missing, malformed, or token invalid/expired.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
429RATE_LIMITEDThe token's request allowance is exhausted. Retry after the Retry-After header.
-
404SEARCH_JOB_NOT_FOUNDNo rebuild with this id exists for the store, or it is past retention.