Skip to content

Unified Search

Unified Search is the recommended way to search with Ecommerce Search. It provides access to the following data sources and features from a single endpoint:

See the full POST /search API reference here.

The term facet values returned in the response can be limited and searched with the facets request property — see Limiting facet values.

Example

Simple request to Unified Search

Request
1
2
3
4
5
{
"segmentId": "b2c-dk-en",
"scopeId": "browse",
"phrase": "bicycle"
}
Response shortened for brevity.

Response
{
    "products": [
        ...
    ],
    "content": [
        ...
    ],
    "facets": [
        ...
    ],
    "suggestions": [
        ...
    ],
    "didYouMean": [
        ...
    ],
    "relatedTags": [
        ...
    ],
    "quickSearchSpotlights": [
        ...
    ],
    "conversationalFiltering": null,
    "action": null,
    "numberOfRequestedProductResults": 36,
    "totalProducts": 0,
    "totalSkus": null,
    "totalSuggestions": 0,
    "totalRelatedTags": 0,
    "originalPhrase": "bicycle",
    "usedPhrase": "bicycle",
    "productOffset": 0,
    "numberOfRequestedContentResults": 1,
    "totalContent": 0
}

Breaking changes in V26

In V26, the return models for suggestions, didYouMean, relatedTags, and aiRelatedTags have changed from simple string arrays to object arrays. This provides information about which data sources have hits for each suggestion or tag and allows for future extensibility.

Field V25 (old) V26 (new)
suggestions string[] { phrase, hits[] }[]
didYouMean string[] { phrase }[]
relatedTags string[] { phrase, hits[], tag }[]
aiRelatedTags string[] { phrase, hits[] }[]

V26 response structure

{
    "suggestions": [
        {
            "phrase": "Shorts for women",
            "hits": ["Product"]
        }
    ],
    "didYouMean": [
        {
            "phrase": "Shorts for women"
        }
    ],
    "relatedTags": [
        {
            "phrase": "gentleman outdoor shoes",
            "hits": ["Product", "Content"],
            "tag": "shoes"
        }
    ],
    "aiRelatedTags": [
        {
            "phrase": "gentleman outdoor shoes",
            "hits": ["Product", "Content"]
        }
    ]
}

Automatic corrections

Registered misspellings are replaced before the search runs. A phrase containing a registered misspelling therefore returns the corrected phrase as usedPhrase, with phraseOptimized set to true, and the corrected phrase is what the redirect check and all result types use.

If a search phrase returns no results, the first suggestion from Did You Mean is automatically used for a second search, which may return results. This allows misspelled searches to be corrected without the end user having to perform a second search.

Automatic correction

Note the deliberate misspelling of bicykle

Request
1
2
3
4
5
{
    "segmentId": "b2c-dk-en",
    "scopeId": "full-search",
    "phrase": "bicykle"
}
Response
1
2
3
4
5
6
7
{
    "didYouMean": [
        "bicycle"
    ],
    "originalPhrase": "bicykle",
    "usedPhrase": "bicycle"
}

The automatic correction functionality, both the misspelling replacement and the Did You Mean fallback, can be disabled by setting forceSearch to true in the request.

Disabling automatic corrections

Request
1
2
3
4
5
6
{
    "segmentId": "b2c-dk-en",
    "scopeId": "full-search",
    "phrase": "bicykle",
    "forceSearch": true
}
Response
1
2
3
4
5
6
7
{
    "didYouMean": [
        "bicycle"
    ],
    "originalPhrase": "bicykle",
    "usedPhrase": "bicykle"
}