public abstract class FieldValueHitQueue extends PriorityQueue
FieldCache.DEFAULT
for maintaining
internal term lookup tables.
This class will not resolve SortField.AUTO types, and expects the type
of all SortFields used for construction to already have been resolved.
SortField.detectFieldType(IndexReader, String)
is a utility method which
may be used for field type detection.
NOTE: This API is experimental and might change in
incompatible ways in the next release.Searcher.search(Query,Filter,int,Sort)
,
FieldCache
Modifier and Type | Field and Description |
---|---|
protected FieldComparator[] |
comparators |
protected SortField[] |
fields
Stores the sort criteria being used.
|
protected int[] |
reverseMul |
heap
Modifier and Type | Method and Description |
---|---|
static FieldValueHitQueue |
create(SortField[] fields,
int size)
Creates a hit queue sorted by the given list of fields.
|
protected abstract boolean |
lessThan(java.lang.Object a,
java.lang.Object b)
Determines the ordering of objects in this priority queue.
|
add, adjustTop, clear, getSentinelObject, initialize, insert, insertWithOverflow, pop, put, size, top, updateTop
protected final SortField[] fields
protected final FieldComparator[] comparators
protected final int[] reverseMul
public static FieldValueHitQueue create(SortField[] fields, int size) throws java.io.IOException
NOTE: The instances returned by this method
pre-allocate a full array of length numHits
.
fields
- SortField array we are sorting by in priority order (highest
priority first); cannot be null
or emptysize
- The number of hits to retain. Must be greater than zero.java.io.IOException
protected abstract boolean lessThan(java.lang.Object a, java.lang.Object b)
PriorityQueue
lessThan
in class PriorityQueue
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.