PostingsHighlighter is a new highlighter in Solr4.3 to summarize documents for summary results.
There are already two highlighters, why another?
- What postingshighlighter is:
- Uses significantly less disk space than term vectors (~ 1.1byte/position for wikipedia).
- Passage ranking algorithm focuses on good document summaries.
- A performant approach if queries have a relatively low number of terms compared to number of results displayed per page.
- What postingshighlighter is not:
- Not a query/matching debugger: It just tries to summarize the document with respect to the query terms. If you want to "highlight wildcards", you won't be very happy with this. On the other hand if you want fast highlighting for full-text search, read on.
- Not for broken analysis chains: When you use
storeOffsetsWithPositions, IndexWriter enforces that the offsets are correct and won't allow bogus data into the index. This allows for efficient highlighting algorithms and data compression.
- Not for the risk-adverse: The code is very new and probably still has some exciting bugs!
This is a configuration with all the defaults. All of the configuration can be specified at query-time too, and per-field (e.g. f.text.hl.tag.post=xxxx):
To use this highlighter, you need to store offsets in parallel with the position data in the index.
See the javadoc for a full description.