-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Description
In #67325 add max_analyzed_offset allows users to limit the highlighting of text fields.
but when using "index_options": "offsets" in mappings, this max_analyzed_offset offset limit can not be limited, because it would use OffsetSource.ANALYSIS and PostingsOffsetStrategy to highlight field.
Some tests can simply explain: link
When a string="Testing Fun Testing Fun" need to be highlight
Using UnifiedHighlighter.OffsetSource.ANALYSIS with queryMaxAnalyzedOffset=10 would response:
"Testing <b>Fun</b> Testing Fun"
because in #67325 add LimitTokenOffsetAnalyzer
BUT USING UnifiedHighlighter.OffsetSource.POSTINGS which index_options=offsets with queryMaxAnalyzedOffset=10 would response:
"Testing <b>Fun</b> Testing <b>Fun</b>"
because offset can not be limited by LimitTokenOffsetAnalyzer
Proposal
may be can add a new LimitedOffsetsEnum to limit this
Link PR: #86110