public class TokenStreamOffsetStrategy extends AnalysisOffsetStrategy
OffsetsEnum
wrapping the TokenStream
filtered to terms
in the query, including wildcards. It can't handle position-sensitive queries (phrases). Passage accuracy suffers
because the freq() is unknown -- it's always Integer.MAX_VALUE
instead.analyzer
automata, field, phraseHelper, terms
Constructor and Description |
---|
TokenStreamOffsetStrategy(String field,
BytesRef[] terms,
PhraseHelper phraseHelper,
CharacterRunAutomaton[] automata,
Analyzer indexAnalyzer) |
Modifier and Type | Method and Description |
---|---|
List<OffsetsEnum> |
getOffsetsEnums(IndexReader reader,
int docId,
String content)
The primary method -- return offsets for highlightable words in the specified document.
|
getOffsetSource, tokenStream
createAutomataOffsetsFromTerms, createOffsetsEnumsFromReader, getField
public TokenStreamOffsetStrategy(String field, BytesRef[] terms, PhraseHelper phraseHelper, CharacterRunAutomaton[] automata, Analyzer indexAnalyzer)
public List<OffsetsEnum> getOffsetsEnums(IndexReader reader, int docId, String content) throws IOException
FieldOffsetStrategy
getOffsetsEnums
in class FieldOffsetStrategy
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.