Skip to content

Redirects

Redirects allow Ecommerce Search to detect that a search phrase points at a specific destination — either a known entity in the product catalog, such as a category name, product name, SKU, or custom attribute, or a URL chosen by an administrator — and instruct the frontend to navigate the user there rather than displaying generic search results.

Why redirects?

Many shops invest significant effort in optimizing category landing pages with curated branding, boost configurations, quick filters, and subcategory navigation. However, when a user searches for "running shoes", the search result page returns a broad result set — missing all the curated work done on the "Running Shoes" category page.

Redirects bridge this gap by sending users directly to these optimized pages when their search intent clearly maps to a specific category or product.

Not every search intent has a destination in the catalog, however. Phrases such as "opening hours", "customer service", "store finder", and "delivery terms" refer to pages that sit around the catalog rather than inside it, and such a page may even live on another domain, such as a hosted support portal. A URL redirect covers this gap by pointing a phrase directly at a relative or absolute URL.

How it works

When a user searches with a FullSearch or QuickSearch scope, Ecommerce Search performs a redirect check before executing the search:

User searches "Running Shoes"
┌──────────────────────────┐
│   Excluded Phrases       │ ◄── Is this phrase excluded from redirects?
│   (HashSet lookup)       │
└────────────┬─────────────┘
             │ Not excluded
┌──────────────────────────┐
│   Phrase Mappings        │ ◄── Is there a manual mapping for this phrase?
│   (Dictionary lookup)    │
└────────────┬─────────────┘
             │ No mapping found
┌──────────────────────────┐
│   Possible Hit Cache     │ ◄── Fast pre-check: could this phrase match?
│   (bloom filter)         │
└────────────┬─────────────┘
             │ Possible match
┌──────────────────────────┐
│   Redirect Resolver      │ ◄── Validates against actual product data
│   (cached + ES)          │
└────────────┬─────────────┘
             │ Confirmed match
┌──────────────────────────┐
│   Return action object   │
│ with the redirect target │
└──────────────────────────┘

A phrase mapping short-circuits the remaining steps. A mapping to a URL is returned straight away, because a URL has nothing to verify against the product data.

The redirect check only runs when:

  • A search phrase is present
  • The search is a pristine search (no user-applied filters or facets)
  • Redirect settings are enabled for the segment — at least one redirect field is enabled, or URL redirects are

Redirect types

Category redirect

When enabled, if the search phrase exactly matches a category name that exists uniquely in the product catalog, the response includes a redirect to that category.

Example: Searching "Running Shoes" when a category named "Running Shoes" exists with a unique category path and contains at least one product.

Product name redirect

When enabled, if the search phrase exactly matches a product name and resolves to exactly one unique product, the response includes a redirect to that product detail page (PDP).

SKU ID / SKU number redirect

When enabled, if the search phrase matches a SKU ID or SKU number and resolves to exactly one unique product, the response includes a redirect to that product.

Custom attribute redirect

Custom string attributes from the product catalog can be configured as redirect sources. For example, if a "brand" attribute is configured, searching for "Nike" could redirect to a brand-filtered product listing page (PLP).

URL redirect

When enabled, a search phrase can redirect to a URL instead of a page derived from the product catalog:

  • A relative URL points at a page on the shop itself, such as /campaign/black-friday. The frontend routes to it within the storefront.
  • An absolute URL points at a page outside the shop, such as https://external-customer-support/faq. The frontend navigates away from the storefront.

The distinction is carried in the search response so the frontend can pick the right kind of navigation without inspecting the URL itself.

Note

URL redirects exist only as phrase mappings. There is no automatic resolution for them, because Ecommerce Search holds no data from which a URL could be inferred — an administrator must state the target explicitly.

Validation rules

Before a redirect is triggered, it must pass validation:

Redirect type Validation rule
Category Category name must be globally unique (only one category path) and contain at least one product
Product name Must resolve to exactly one unique product ID (variants are allowed)
SKU ID Must resolve to exactly one unique sku
SKU number Must resolve to exactly one unique sku
Custom attribute Must resolve to at least one product with matching attribute value
URL Format only: a relative URL must start with a single /, and an absolute URL must be a well-formed http or https URL including a host

Note

A URL is validated for format, not for destination. Ecommerce Search does not know the storefront's routing and cannot tell whether an external page still exists, so choosing a URL that resolves is the administrator's responsibility.

Excluded search phrases

Certain search phrases can be excluded from ever triggering a redirect. This is useful for generic or high-traffic terms like "sale", "new arrivals", or "clearance" where a redirect would be disruptive to the browsing experience.

When a user searches for an excluded phrase, the redirect check is skipped entirely — the search proceeds as a normal search regardless of whether the phrase matches a category, product, or custom attribute, and regardless of whether it is mapped to a URL.

Excluded phrase example

A shop has a category named "Sale". Without an exclusion, searching for "sale" would redirect to the Sale category page. By adding "sale" as an excluded phrase, the user sees normal search results instead.

Excluded phrases are matched case-insensitively.

Phrase mappings

Phrase mappings provide a manual override for redirect behavior. A phrase mapping links a specific search phrase to a redirect target — a category, a custom attribute value, or a URL — bypassing the normal redirect resolution logic.

This is useful when:

  • The automatic redirect resolves to the wrong target (e.g., a phrase matches multiple categories)
  • A desired redirect cannot be detected automatically (e.g., mapping "sneakers" to the "Running Shoes" category)
  • The phrase has no destination in the catalog at all and should lead to a URL instead (e.g., mapping "opening hours" to /openingHours)
  • Marketing campaigns require specific redirects for branded search terms

Each phrase mapping specifies:

Field Description
Search phrase The phrase that triggers the redirect (case-insensitive)
Target type FieldValue for a field target, or RelativeUrl or AbsoluteUrl for a URL target
Field name The target redirect field (a category or enabled custom attribute). Field targets only.
Field value ID The specific value to redirect to (e.g., a category ID or attribute value). Field targets only.
URL The relative or absolute URL to redirect to. URL targets only.

Exactly one target is set per mapping: either the field name and field value ID, or the URL.

Note

A field target supports only category and custom string attribute fields — product name, SKU ID, and SKU number redirects must use the automatic redirect logic. A URL target has no field at all, and a phrase mapping is the only way to redirect to a URL.

Resolution priority

When a search phrase is received, the redirect system evaluates in this order:

  1. Excluded phrases — if the phrase is excluded, no redirect is triggered
  2. Phrase mappings — if a manual mapping exists, use it directly
  3. Automatic redirect resolution — standard category/product/SKU/attribute matching

Note

A URL mapping is skipped while urlRedirectsEnabled is off, and the phrase falls through to automatic redirect resolution. A disabled URL mapping therefore does not suppress a field-value redirect that the same phrase would otherwise produce.

Search response

When a redirect is detected, the search response includes an action object describing the redirect. The redirectType property states which kind of redirect fired, and exactly one payload member is populated to match:

redirectType Populated member What the frontend does
Filter filters Applies the filters to reach the redirected result
RelativeUrl relativeUrl Routes to the URL within the storefront
AbsoluteUrl absoluteUrl Navigates away from the storefront

Full search response with a field-value redirect

{
    "action": {
        "redirect": {
            "redirectType": "Filter",
            "filters": {
                "CategoryIds": "42"
            }
        }
    },
    "originalPhrase": "running shoes",
    "usedPhrase": "running shoes",
    "products": [],
    "totalProducts": 0
}

Response with a relative URL redirect

{
    "action": {
        "redirect": {
            "redirectType": "RelativeUrl",
            "relativeUrl": "/openingHours"
        }
    },
    "originalPhrase": "opening hours",
    "usedPhrase": "opening hours",
    "products": [],
    "totalProducts": 0
}

Response with an absolute URL redirect

{
    "action": {
        "redirect": {
            "redirectType": "AbsoluteUrl",
            "absoluteUrl": "https://external-customer-support/faq"
        }
    },
    "originalPhrase": "customer service",
    "usedPhrase": "customer service",
    "products": [],
    "totalProducts": 0
}

Redirect behavior depends on both the search type and the kind of redirect:

Search type Field-value redirect URL redirect
Full search Returns only the action object — no products, content, or other results. The frontend should navigate immediately. Returns only the action object. The frontend should navigate immediately.
Quick search Returns limited results and no action object. The redirect filters are applied internally, so the returned products already match the redirect target. Returns only the action object — no products, no content, and zero totals, because nothing in the index corresponds to a URL.

Note

A URL redirect is the only case in which quick search returns an action object, and such a response carries no products by design — it is not a no-results response.

How to present it is the storefront's decision. Offering the destination in the dropdown for the user to choose is usually preferable to navigating away while the user is still typing. Navigating immediately is the natural behavior for full search, where the user has submitted the search.

Configuration

Redirect settings are configured per segment through the Admin API or the admin UI. Changes go through the publication flow, meaning they must be published before they take effect in live searches.

Setting Description
categoryEnabled Enable redirects when the search phrase matches a category name
productNameEnabled Enable redirects when the search phrase matches a product name
skuIdEnabled Enable redirects when the search phrase matches a SKU ID
skuNoEnabled Enable redirects when the search phrase matches a SKU number
urlRedirectsEnabled Allow phrase mappings to redirect to a relative or absolute URL
customAttributes List of custom string attributes to enable for redirects

Note

urlRedirectsEnabled gates both configuration and live search. While it is off, a URL phrase mapping cannot be created, and published URL mappings are ignored during search. Turning it off does not delete existing URL mappings, so turning it back on and publishing the segment brings them into effect again.

Both excluded phrases and phrase mappings are configured per segment and go through the publication flow.

See Handling Redirects for frontend implementation details and API reference.