The highlighting parameter
Elasticsearch allows you to emphasize the match terms in your query by means of the highlighting feature to improve the user experience. If the store parameter is not specified for the relevant fields in the mappings, then the highlighting fields are extracted from the _source parameter. All matching words will be rendered in a small portion of the original text in the highlight object field of the response body. Three highlighters are supported—unified, plain, and Fast Vector Highlighter (fvh). There are several parameters that can be passed in the search request to control the highlighting process, as shown in the following table. These settings can be declared in the global scope or in the local scope (field ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access