FieldCache.DEFAULT
for maintaining
- * internal term lookup tables.
- *
- * @lucene.experimental
- * @since 2.9
- * @see Searcher#search(Query,Filter,int,Sort)
- * @see FieldCache
- */
-public abstract class FieldValueHitQueuea
is less relevant than b
.
- * @param a ScoreDoc
- * @param b ScoreDoc
- * @return true
if document a
should be sorted after document b
.
- */
- @Override
- protected boolean lessThan(final Entry hitA, final Entry hitB) {
-
- assert hitA != hitB;
- assert hitA.slot != hitB.slot;
-
- final int c = oneReverseMul * comparator.compare(hitA.slot, hitB.slot);
- if (c != 0) {
- return c > 0;
- }
-
- // avoid random sort order that could lead to duplicates (bug #31241):
- return hitA.doc > hitB.doc;
- }
-
- }
-
- /**
- * An implementation of {@link FieldValueHitQueue} which is optimized in case
- * there is more than one comparator.
- */
- private static final class MultiComparatorsFieldValueHitQueueNOTE: The instances returned by this method
- * pre-allocate a full array of length numHits
.
- *
- * @param fields
- * SortField array we are sorting by in priority order (highest
- * priority first); cannot be null
or empty
- * @param size
- * The number of hits to retain. Must be greater than zero.
- * @throws IOException
- */
- public static