A search system retrieves, ranks and summarizes information. Start with catalog requirements before choosing a tool.
course-products examples use the teaching mapping and product from chapter 5, “Mapping and field types”. Exercise walkthroughs below use the trainer’s separate public dataset.
- From values to intent
- Responsibility boundaries
- Choosing a tool
A search system retrieves, ranks and summarizes information. Start with catalog requirements before choosing a tool.
The course targets Elasticsearch 9.4.3. Exercise examples use the public products dataset; other requests illustrate separate teaching indices and may require setup or privileges unavailable in the trainer. Responses are shortened fragments; scores may vary. Check deployment and license requirements for advanced features.
From values to intent
A shopper enters “headphones for running”, not a SQL predicate. Useful results depend on words, attributes, stock and ordering. An exact SKU lookup and a description search need different rules: the SKU identifies a product, while the description expresses intent. Relevance means usefulness for a particular query, rather than the number of matching letters.
Check your understandingResponsibility boundaries
The primary database owns orders, prices and business invariants. Elasticsearch receives a search projection combining a product, brand and offers. Projection updates are commonly asynchronous, so checkout must validate price and stock against the authoritative system. Transactional correctness must not depend on the freshness of the search index.
Check your understandingChoosing a tool
A small lookup table may only need a database index or built-in full-text search. Elasticsearch becomes useful when controlled relevance, language analysis, facets or distributed load matter. Its cost includes synchronization, infrastructure and observability. Query DSL expresses search trees; ES|QL supports tabular analysis and EQL event sequences. These languages do not remove the need for data modeling.
Candidate retrieval: matching alone does not guarantee a useful order.
{
"size": 3,
"query": {
"match": {
"name": "wireless"
}
}
}How to read this result
Candidate retrieval: matching alone does not guarantee a useful order.
Catalog reasoning example
For “Sony headphones under 100”, separate product type, brand and budget. Text matching retrieves candidates; brand and price constrain eligibility. “Cheapest first” expresses another preference and can replace relevance ordering. Before choosing an engine, test whether the current database already handles these flows. Two exact filters over a small catalog may not justify a separate cluster. Language variants, facets and controlled ranking create a stronger case for a measured comparison.
Check your understandingCheck your understanding
Answer before expanding each explanation.
1. How does SKU lookup differ from description search?
A SKU needs exact identity; descriptions need text analysis and ranking.
2. Where should checkout validate prices?
In the authoritative system, because the search projection can lag.
3. When is a database sufficient?
When its search meets quality and load requirements without another index.
4. What contributes to Elasticsearch cost?
Servers, change delivery, backups, monitoring and schema maintenance.
5. How do you define search success?
Use user scenarios, judged queries, quality metrics and latency budgets.
Key takeaways
- A SKU needs exact identity; descriptions need text analysis and ranking.
- In the authoritative system, because the search projection can lag.
- When its search meets quality and load requirements without another index.
- Servers, change delivery, backups, monitoring and schema maintenance.
- Use user scenarios, judged queries, quality metrics and latency budgets.
Official reference
Ready to put this into practice?
Confirm reading to save your place. Reading and exercise progress are tracked separately in this browser using your guest cookie.