Class PhraseWildcardQuery.SegmentTermsSizeComparator

  • All Implemented Interfaces:
    Enclosing class:

    protected class PhraseWildcardQuery.SegmentTermsSizeComparator
    extends Object
    implements Comparator<LeafReaderContext>
    Compares segments based of the number of terms they contain.

    This is used to sort segments incrementally by number of terms. This way the first segment to search is the smallest, so a term has the lowest probability to match in this segment. And if the term does not match, we credit unused expansions when searching the other next segments.