Class TokenStreamOffsetStrategy


  • public class TokenStreamOffsetStrategy
    extends AnalysisOffsetStrategy
    Analyzes the text, producing a single 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.
    • Constructor Detail

      • TokenStreamOffsetStrategy

        public TokenStreamOffsetStrategy​(UHComponents components,
                                         Analyzer indexAnalyzer)
    • Method Detail

      • getOffsetsEnum

        public OffsetsEnum getOffsetsEnum​(LeafReader reader,
                                          int docId,
                                          java.lang.String content)
                                   throws java.io.IOException
        Description copied from class: FieldOffsetStrategy
        The primary method -- return offsets for highlightable words in the specified document. Callers are expected to close the returned OffsetsEnum when it has been finished with
        Specified by:
        getOffsetsEnum in class FieldOffsetStrategy
        Throws:
        java.io.IOException