public class OcrFieldHighlighter
extends org.apache.lucene.search.uhighlight.FieldHighlighter
FieldHighlighter to support lazy-loaded field values and byte offsets from payloads.| Modifier and Type | Field and Description |
|---|---|
protected FieldByteOffsetStrategy |
fieldByteOffsetStrategy |
| Constructor and Description |
|---|
OcrFieldHighlighter(String field,
org.apache.lucene.search.uhighlight.FieldOffsetStrategy fieldOffsetStrategy,
FieldByteOffsetStrategy fieldByteOffsetStrategy,
org.apache.lucene.search.uhighlight.PassageScorer passageScorer,
BreakIterator breakIter,
OcrPassageFormatter formatter,
int maxPassages,
int maxNoHighlightPassages) |
| Modifier and Type | Method and Description |
|---|---|
int |
getNumMatches(int docId) |
protected org.apache.lucene.search.uhighlight.Passage[] |
getSummaryPassagesNoHighlight(int maxPassages)
We don't provide summaries if there is no highlighting, i.e.
|
protected org.apache.lucene.search.uhighlight.Passage[] |
highlightByteOffsetsEnums(ByteOffsetsEnum off,
int docId,
String pageId)
Highlight passages from the document using the byte offsets in the payloads of the matching terms.
|
OcrSnippet[] |
highlightFieldForDoc(org.apache.lucene.index.LeafReader reader,
int docId,
IterableCharSequence content,
String pageId)
The primary method -- highlight this doc, assuming a specific field and given this content.
|
protected org.apache.lucene.search.uhighlight.Passage[] |
highlightOffsetsEnums(org.apache.lucene.search.uhighlight.OffsetsEnum off) |
protected org.apache.lucene.search.uhighlight.Passage[] |
highlightOffsetsEnums(org.apache.lucene.search.uhighlight.OffsetsEnum off,
int docId,
String pageId) |
protected FieldByteOffsetStrategy fieldByteOffsetStrategy
public OcrFieldHighlighter(String field, org.apache.lucene.search.uhighlight.FieldOffsetStrategy fieldOffsetStrategy, FieldByteOffsetStrategy fieldByteOffsetStrategy, org.apache.lucene.search.uhighlight.PassageScorer passageScorer, BreakIterator breakIter, OcrPassageFormatter formatter, int maxPassages, int maxNoHighlightPassages)
public OcrSnippet[] highlightFieldForDoc(org.apache.lucene.index.LeafReader reader, int docId, IterableCharSequence content, String pageId) throws IOException
FieldHighlighter.highlightFieldForDoc(LeafReader, int, String), modified to support
an IterableCharSequence as content.IOExceptionprotected org.apache.lucene.search.uhighlight.Passage[] highlightOffsetsEnums(org.apache.lucene.search.uhighlight.OffsetsEnum off)
throws IOException
highlightOffsetsEnums in class org.apache.lucene.search.uhighlight.FieldHighlighterIOExceptionprotected org.apache.lucene.search.uhighlight.Passage[] highlightOffsetsEnums(org.apache.lucene.search.uhighlight.OffsetsEnum off,
int docId,
String pageId)
throws IOException
IOExceptionprotected org.apache.lucene.search.uhighlight.Passage[] highlightByteOffsetsEnums(ByteOffsetsEnum off, int docId, String pageId) throws IOException
FieldHighlighter.highlightOffsetsEnums(OffsetsEnum), modified to load the byte offsets
from the term payloads.IOExceptionprotected org.apache.lucene.search.uhighlight.Passage[] getSummaryPassagesNoHighlight(int maxPassages)
getSummaryPassagesNoHighlight in class org.apache.lucene.search.uhighlight.FieldHighlighterpublic int getNumMatches(int docId)
Copyright © 2019. All rights reserved.