Reference Entry
Real-World Recipes
Guides · foundation · order 30
Practical patterns for docs search, blog search, product filtering, related content, and lightweight semantic retrieval.
Relevant APIs
Real-World Recipes
Querylight TS is a toolkit, so the main question is which field layout, query pattern, and deployment flow match your use case.
These recipes give you a starting shape for each.
Documentation search
Use:
title,summary, andbodyfields- metadata fields such as
sectionandtags - prebuilt serialized index state
- optional chunked vector search for question-style retrieval
This is the pattern used throughout the demo.
Typical query shape:
MatchQueryorMultiMatchQueryovertitle,summary, andbodyBoolQuery.filterforsection,tags, or product/version metadata- optional chunk-level vector retrieval for question-style search
Blog or article search
Use:
- title and body search
- tags and date-like metadata
- a combined field for broad recall
- highlighting for result snippets
If date ordering matters, keep sortable string representations available for filters or secondary sorting logic.
Typical query shape:
MatchQueryovertitle- broader
MatchQueryor combined-field search overbody - optional
BoolQuery.filteron tags, authors, or date ranges
Product or catalog search
Use:
- exact metadata fields for category, brand, and availability
- free-text fields for title and description
- facets for drill-down navigation
- autocomplete for product-name discovery
This is where field separation matters most.
Typical query shape:
- lexical query over
titleanddescription - exact filters for category, brand, availability, and price ranges
- terms or range aggregations for the current result set
Related content
Use:
- lexical overlap from tags and title
- optional vector similarity for semantic relatedness
- RRF if you want to combine both
This works well for article recommendations and “read next” widgets.
Typical query shape:
- start with shared tags, series, or categories as a lexical baseline
- add vector similarity when topical overlap is not enough
- use RRF when both signals add value
Location-aware search
Use:
- text fields for names and descriptions
GeoFieldIndexfor geographic constraints- optional lexical plus geo fusion when both topic and location matter
Typical query shape:
- lexical match on name or description
GeoPointQueryorGeoPolygonQueryinside aBoolQuery.filter- optional secondary ranking logic for distance or topical relevance
A reasonable default architecture
If you are unsure where to start:
- model explicit metadata fields
- add a combined catch-all field
- prebuild and serialize the index
- add facets or autocomplete only where needed
- add vector features only after lexical search is already solid
That sequence keeps the system understandable, keeps the first version shippable, and leaves room for more advanced retrieval later.