search_id
that can be used with the Search API to execute with lower latency.
- Use with: Search API via the
search_id
body parameter
Authorization
Token-based authentication header in the form of
<YOUR_LAYERS_TOKEN>
. Same requirements as the Search API.Headers
Path Parameters
The url-encoded search query to prepare.
Body
Optional hint for which product attributes you intend to include in the eventual Search response. If omitted, defaults will be used by the Search API.
Parameters to fine-tune the search results.
Refer to our dedicated Filter Expressions guide to learn more about filter expressions.
Facets to be included.
If the count of each facet value should be calculated
If you want a min/max range for numeric facets such as price.
Information used to current identify the customer/session.
Anonymous contextual information of the session/customer.
Behavior
- Returns HTTP 202 (Accepted) immediately with a
search_id
- Generates a ULID
search_id
that identifies the prepared search - Dispatches an asynchronous background job on a high-priority queue
- Pre-computes embeddings and AI-powered query expansions
- Prepared data is cached for up to 5 minutes; after TTL, Search falls back to normal processing
Response
202 Accepted
ULID identifier for the prepared search. Valid for 5 minutes.
Error Conditions
- 401 Unauthorized: Missing/invalid
X-Storefront-Access-Token
- 422 Unprocessable Entity: Invalid body or parameters
Next Steps
Use the returnedsearch_id
with the Search API in the search_id
body parameter to execute an optimized search.