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(java.lang.String field,
BytesRef[] terms,
PhraseHelper phraseHelper,
CharacterRunAutomaton[] automata,
Analyzer indexAnalyzer) |
Modifier and Type | Method and Description |
---|---|
java.util.List<OffsetsEnum> |
getOffsetsEnums(IndexReader reader,
int docId,
java.lang.String content)
The primary method -- return offsets for highlightable words in the specified document.
|
getOffsetSource, tokenStream
createAutomataOffsetsFromTerms, createOffsetsEnumsFromReader, getField
public TokenStreamOffsetStrategy(java.lang.String field, BytesRef[] terms, PhraseHelper phraseHelper, CharacterRunAutomaton[] automata, Analyzer indexAnalyzer)
public java.util.List<OffsetsEnum> getOffsetsEnums(IndexReader reader, int docId, java.lang.String content) throws java.io.IOException
FieldOffsetStrategy
getOffsetsEnums
in class FieldOffsetStrategy
java.io.IOException
Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.