Searching
Searching for products is the most important part of Ecommerce Search. Most of the other features are designed to enhance the product search experience.
- Searching for SKUs
- Exporting products and SKUs
- Searching for everything, with one request using Unified Search.
To learn how to use search, read through the tutorial.
Phrase
The most basic element of the search request is the phrase. The phrase refers to the text provided by the user, that the user wants to search for. The phrase can be modified by the text analysis pipeline to model linguistic structures, such as hypernyms or misspellings.
Pagination
The search response can be paginated by setting an offset
and numberOfResults
.
It should not be used to do a paged export of data, use the POST /sku-export
endpoint for that instead. See the full API reference here.
Sorting
Ecommerce Search's allows configurable sorting of search results based on predefined fields or custom attributes, in either ascending or descending order.
Segment
When searching for products, a segmentId
is needed to select the correct search dataset. The segment determines which products to search for, but also which synonyms to apply, along with hypernyms and other text-analysis configurations. It is therefore important that the correct segment is chosen.
Context
The context affects both the commercial sorting of the returned products, but also which facets are returned in a search response. The search request does not specify a contextId
, instead, it automatically selects the best-fitting context based on the search request. When searching for products, Ecommerce Search resolves the best-fitting context according to context conditions.
Filters
Filters for products, SKUs, content and exports work in the same way. Read more here.
Scope
A scope is required to complete a search request. The scope is used to resolve the context and apply domain filters.
Scopes determine the default number of results and SKUs per result. Scopes also determine which fields are returned in the search response. These values can be overwritten in the search request.
Given a scope with the following fieldsToReturn
:
- ProductName
- Price
- Media
A search with this scope then returns.
The name and media link of the product and the price of the SKU are returned. All the other fields are still there, just without any data. Even though the fields are there, the search is optimized to only retrieve the specified fields from the dataset, so limiting which fields a scope returns will affect the performance of the search.
Personalization
The userId
is used to enable personalized sorting.
Pinning
It is possible to pin products to the top of a search result. Both products and skus can be pinned by their id.
Pinned products have the following characteristics:
- The order of pinned products is fixed. The first product in the list will be first in the result and so on.
- A pinned product appears if and only if they are part of the search result. Irrelevant product will never be returned.
- A pinned product only appears once, and does not reappear in the list of sorted products.
A product search query, like below, will return the product product_id_3 and product containing the sku with id sku_id_15 if they contain the word shoes in the searchable fields.
Request | |
---|---|
Unified search
Unified Search provides access to various data sources and features such as products, content, suggestions, related tags, and Did You Mean from a single endpoint, with automatic correction functionality for misspelled search phrases.
Authenticated search
It is possible to specify filters that cannot be changed by end users. These can be set in the AuthenticationToken. See Authenticated Search. This is used for getting prices for other price groups than the default one.
Suggestions
Searching for suggestions is useful to help guide users toward their intended search phrase. It can also help users who are not sure how to spell something. To search for suggestions, suggestion candidates must first be created.
Given a suggestion candidate tshirt
, searching for suggestions is as simple as:
Provides this suggestion.
Did you mean
Did You Mean provides alternative search phrases for user searches that contain typos or misspellings, improving search results by correcting simple misspellings, typos, missing spaces, extra spaces, and missing hyphens.
Semantic fallback search
Semantic search can help solve 0-result searches.