How product search works

This guide covers: how shoppers filter and revisit searches, and how Catalog updates the Elasticsearch search index.
About this guide

Prepared with AI under human direction. Search defaults, variant indexing and stock filtering were checked against source on 12 September 2026. The recordings show July 2026 behavior. Sources: search document, query filters and stock projection.

1. What search does

Shoppers search and filter published products. Catalog manages the product records and updates a separate Elasticsearch index for search.

Customer experienceFind, refine and return.

Shoppers can search in several languages or by SKU and EAN, apply filters, sort results and reopen the same search from its URL.

Operational continuitySaved changes are queued for indexing.

Product and Stock changes queue an indexing job. Repeated changes to one product are grouped, and the worker reads its latest state before updating or removing the search document.

Practical example: publishing makes a product searchable, renaming changes what query finds it, selling out can hide it, receiving stock can restore it, and archiving removes it without a shopper or manager running a reindex.

2. Refine, sort, reload

A shopper narrows a real category and returns to the same search state after browser reload.

FACETS + URL STATE / 2M 16.52S

Refine, sort, reload

Matter compatibility, AeroClean brand, battery power, free text and price order reduce the list while result and facet counts stay useful. Reload restores the complete state from the URL.

3. Product lifecycle changes search

INDEX LIFECYCLE / 1M 28.92S

Publish, rename, archive

The Aurora field camera is absent before publication, appears when published, answers to its new localized name after an edit and disappears after archival. No manual reindex appears in the journey.

4. Availability changes search visibility

STOCK PROJECTION / 43.36S

Hide sold out; restore on receipt

The Astra wireless headset starts with six units, leaves storefront search after a warehouse write-off and returns after a receipt adds twelve. Stock remains the authority throughout.

5. One Product, many ways to find it

RELEVANCE + IDENTIFIERS / 1M 12.64S

Names, languages, SKU and EAN

A rare exact-name match outranks a description-only match. French, German and Italian names plus exact SKU and EAN searches resolve the same stable product identity.

6. What changes for the customer

TECHNICAL DEEP DIVE

How storefront search works

Catalog builds search queries and manages index updates. Elasticsearch handles search requests through aliases; Catalog saves product changes independently.

7. Services involved

Search runs inside Catalog, using availability updates from Stock. There is no separate Search service.

Storefront calls Catalog search, Catalog reads Elasticsearch, PostgreSQL owns Catalog state and Kafka carries Stock and product facts into durable index work
Storefront owns URL/search state. Catalog owns query rules, facets, document shape and indexing work. PostgreSQL and Stock remain authoritative; Elasticsearch is the read model.

8. Read path, relevance and facets

Product results group concrete variants. Each indexed product must have an active default variant. A SKU or EAN query matches nested variant identifiers; the result still belongs to the product. Price summaries come from variant commercial values.

The public search endpoint builds a bounded Elasticsearch query from URL-backed storefront state.

Storefront URL state flows through Catalog query builder into Elasticsearch and returns products facets totals and pagination
Default page size is 24, maximum is 100, and product ID provides deterministic secondary sorting. Default ordering uses relevance; explicit sorts include price, newest and English name.
Indexed relevance areaCurrent boostPurpose
Curated product search terms40Gives curated terms the most weight
Category path names / terms8 / 6Category context
Variant SKU and EANExact matchNested variant identifier query, with currency filtering when requested
Product names DE/FR/IT/EN4Names in each language
Description and searchable attribute text1Broad supporting text
Facet behavior: the query separates the main query, post-filter and per-facet aggregations so alternatives remain countable while other constraints stay active. Attribute filters respect ENUM, numeric, boolean and localized-text types.

9. Reliable product indexing

Product events add indexing work to PostgreSQL instead of writing to Elasticsearch directly. Repeated changes to the same product are grouped before the worker reads its current state.

Committed Catalog event records coalesced PostgreSQL index work, worker reloads current product state and upserts or deletes through the write alias
The worker reads the latest product record, so an old event cannot overwrite newer data. Completed jobs are removed; failed jobs remain queued for retry with a bounded delay.

10. Stock updates and visibility

Stock events update Catalog’s availability projection and enqueue the same durable product-index work.

Stock availability event updates Catalog projection, queues current product reindexing and changes storefront visibility through Elasticsearch
Search deliberately keeps products visible while some variant stock is unknown. It hides a product only when every Catalog variant has an OUT_OF_STOCK projection. This differs from Recommendation, which rejects unknown eligibility and rechecks candidates before serving them.

11. Recovery, documents and aliases

The full rebuild scans published products from Catalog, hydrates current metadata and availability, upserts documents, then removes stale IDs.

Full reindex recreates aliases if needed, scans published products in pages, hydrates current state, upserts concurrently and purges stale Elasticsearch documents
Read and write aliases isolate callers from the concrete catalog-products-v1 index. The current code provides a place to add future index migrations but does not implement blue-green alias rotation.
Document areaIndexed facts
IdentityProduct ID, slug and status; default variant identity and nested variant SKU/EAN records
MerchandisingThumbnail, brand, creation time and a price summary derived from variants
CategoryLeaf category, full path IDs, localized names and curated terms
Search textCurated terms plus localized name and description
AttributesNested code/type with enum, numeric, boolean or localized text values
AvailabilityCatalog’s projected inStock value

12. Limits

No Search serviceSearch runs inside Catalog.
No fuzzy correctionThe current query uses analyzed multilingual matching, not automatic spelling correction.
No Elasticsearch write authorityCatalog operational writes never depend on Elasticsearch success.
Unknown Stock is fail-openMissing projection data does not hide an otherwise published product.
No blue-green rotationAliases exist, but automated versioned-index cutover is not delivered.
Development topologyThe development deployment has one Elasticsearch node and does not provide multi-node high availability.