Package org.apache.lucene.search
Class FieldValueHitQueue<T extends FieldValueHitQueue.Entry>
java.lang.Object
org.apache.lucene.util.PriorityQueue<T>
org.apache.lucene.search.FieldValueHitQueue<T>
public abstract class FieldValueHitQueue<T extends FieldValueHitQueue.Entry>
extends PriorityQueue<T>
Expert: A hit queue for sorting by hits by terms in more than one field.
Uses
FieldCache.DEFAULT
for maintaining
internal term lookup tables.- Since:
- 2.9
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Extension of ScoreDoc to also store theFieldComparator
slot. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldComparator<?>[]
protected final SortField[]
Stores the sort criteria being used.protected FieldComparator<?>
protected final int[]
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends FieldValueHitQueue.Entry>
FieldValueHitQueue<T>Creates a hit queue sorted by the given list of fields.FieldComparator<?>[]
int[]
protected abstract boolean
Determines the ordering of objects in this priority queue.void
setComparator
(int pos, FieldComparator<?> comparator) Methods inherited from class org.apache.lucene.util.PriorityQueue
add, clear, getHeapArray, getSentinelObject, insertWithOverflow, pop, size, top, updateTop
-
Field Details
-
fields
Stores the sort criteria being used. -
comparators
-
firstComparator
-
reverseMul
protected final int[] reverseMul
-
-
Method Details
-
create
public static <T extends FieldValueHitQueue.Entry> FieldValueHitQueue<T> create(SortField[] fields, int size) throws IOException Creates a hit queue sorted by the given list of fields.NOTE: The instances returned by this method pre-allocate a full array of length
numHits
.- Parameters:
fields
- SortField array we are sorting by in priority order (highest priority first); cannot benull
or emptysize
- The number of hits to retain. Must be greater than zero.- Throws:
IOException
- if there is a low-level IO error
-
getComparators
-
getReverseMul
public int[] getReverseMul() -
setComparator
-
lessThan
Description copied from class:PriorityQueue
Determines the ordering of objects in this priority queue. Subclasses must define this one method.- Specified by:
lessThan
in classPriorityQueue<T extends FieldValueHitQueue.Entry>
- Returns:
true
iff parameter a is less than parameter b.
-