Overview - Highlighting matched text
What is it?
Highlighting matched text in Elasticsearch means showing the parts of your search results where the search words appear. It helps users quickly see why a document was found by marking the matching words or phrases. This is done by wrapping the matched text with special tags, like or custom tags, to make them stand out.
Why it matters
Without highlighting, users might struggle to understand why a search result is relevant, especially in long documents. Highlighting improves user experience by making search results clearer and faster to scan. It also helps in debugging and refining search queries by showing exactly what matched.
Where it fits
Before learning highlighting, you should understand basic Elasticsearch search queries and how documents are indexed. After mastering highlighting, you can explore advanced search features like multi-field highlighting, custom tags, and performance tuning.