protected class PhraseWildcardQuery.SegmentTermsSizeComparator extends java.lang.Object implements java.util.Comparator<LeafReaderContext>
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.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
COMPARISON_ERROR_MESSAGE |
Modifier | Constructor and Description |
---|---|
protected |
SegmentTermsSizeComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(LeafReaderContext leafReaderContext1,
LeafReaderContext leafReaderContext2) |
protected java.util.List<LeafReaderContext> |
createTermsSizeSortedCopyOf(java.util.List<LeafReaderContext> segments) |
private long |
getTermsSize(LeafReaderContext leafReaderContext) |
private static final java.lang.String COMPARISON_ERROR_MESSAGE
public int compare(LeafReaderContext leafReaderContext1, LeafReaderContext leafReaderContext2)
compare
in interface java.util.Comparator<LeafReaderContext>
protected java.util.List<LeafReaderContext> createTermsSizeSortedCopyOf(java.util.List<LeafReaderContext> segments) throws java.io.IOException
java.io.IOException
private long getTermsSize(LeafReaderContext leafReaderContext) throws java.io.IOException
java.io.IOException