Javadoc
Subclass of the
PostingsHighlighter that works for a single field in a single document.
Uses a custom
PassageFormatter. Accepts field content as a constructor argument, given that loading
is custom and can be done reading from _source field. Supports using different
BreakIterator to break
the text into fragments. Considers every distinct field value as a discrete passage for highlighting (unless
the whole content needs to be highlighted). Supports both returning empty snippets and non highlighted snippets
when no highlighting can be performed.
The use that we make of the postings highlighter is not optimal. It would be much better to highlight
multiple docs in a single call, as we actually lose its sequential IO. That would require to
refactor the elasticsearch highlight api which currently works per hit.