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. UsesFieldCache.DEFAULTfor maintaining internal term lookup tables.- Since:
- 2.9
- See Also:
IndexSearcher.search(Query,Filter,int,Sort),FieldCache
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldValueHitQueue.EntryExtension of ScoreDoc to also store theFieldComparatorslot.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends FieldValueHitQueue.Entry>
FieldValueHitQueue<T>create(SortField[] fields, int size)Creates a hit queue sorted by the given list of fields.FieldComparator<?>[]getComparators()int[]getReverseMul()voidsetComparator(int pos, FieldComparator<?> comparator)-
Methods inherited from class org.apache.lucene.util.PriorityQueue
add, clear, insertWithOverflow, pop, size, top, updateTop
-
-
-
-
Method Detail
-
create
public static <T extends FieldValueHitQueue.Entry> FieldValueHitQueue<T> create(SortField[] fields, int size) throws java.io.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 benullor emptysize- The number of hits to retain. Must be greater than zero.- Throws:
java.io.IOException- if there is a low-level IO error
-
getComparators
public FieldComparator<?>[] getComparators()
-
getReverseMul
public int[] getReverseMul()
-
setComparator
public void setComparator(int pos, FieldComparator<?> comparator)
-
-