<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Highlight on INFINI Pizza</title><link>https://pizza.rs/tags/highlight/</link><description>Recent content in Highlight on INFINI Pizza</description><generator>Hugo</generator><language>en</language><atom:link href="https://pizza.rs/tags/highlight/index.xml" rel="self" type="application/rss+xml"/><item><title>Highlighting</title><link>https://pizza.rs/docs/references/search/request/highlight/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pizza.rs/docs/references/search/request/highlight/</guid><description>&lt;h1 id="highlighting">
 Highlighting
 &lt;a class="anchor" href="#highlighting">#&lt;/a>
&lt;/h1>
&lt;p>Ask for matched fragments of your text fields back alongside each hit, with
the matched terms wrapped in tags — ready to render as a search result list.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sh" data-lang="sh">&lt;span class="line">&lt;span class="cl">POST /my-collection/_search
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="how-it-works">
 How it works
 &lt;a class="anchor" href="#how-it-works">#&lt;/a>
&lt;/h2>
&lt;p>Highlighting is an engine-native enrich step that runs on the returned page
only — after ranking and truncation, exactly like 
 &lt;a href="https://pizza.rs/docs/references/search/request/script-fields/">script
fields&lt;/a>. It has two phases (&lt;code>lib/engine/src/search/highlight/&lt;/code>):&lt;/p>
&lt;p>&lt;strong>1. Term extraction.&lt;/strong> The engine walks the query tree and collects
&lt;code>(field, term)&lt;/code> pairs worth highlighting: &lt;code>term&lt;/code>, &lt;code>terms&lt;/code>, &lt;code>fuzzy&lt;/code>,
&lt;code>span_term&lt;/code>, &lt;code>intervals&lt;/code>, &lt;code>match&lt;/code>, &lt;code>multi_match&lt;/code>, &lt;code>match_phrase&lt;/code>, and
&lt;code>bool&lt;/code> clauses. Text queries (&lt;code>match&lt;/code>, &lt;code>multi_match&lt;/code>, &lt;code>phrase&lt;/code>) are
re-tokenized through the field&amp;rsquo;s search analyzer (or the query&amp;rsquo;s explicit
&lt;code>analyzer&lt;/code> override), so the highlighted terms mirror what the query
scored. &lt;code>must_not&lt;/code> clauses never contribute — documents excluded by them
get no tags from them. &lt;code>match_all&lt;/code>, &lt;code>range&lt;/code>, &lt;code>geo&lt;/code> and
&lt;code>vector&lt;/code> queries carry nothing to highlight.&lt;/p></description></item></channel></rss>