org.apache.lucene.search
Class FieldSortedHitQueue
- java.lang.Object
-
- org.apache.lucene.util.PriorityQueue
-
- org.apache.lucene.search.FieldSortedHitQueue
-
public class FieldSortedHitQueue extends PriorityQueue
Expert: A hit queue for sorting by hits by terms in more than one field. UsesFieldCache.DEFAULTfor maintaining internal term lookup tables.Created: Dec 8, 2003 12:56:03 PM
- Since:
- lucene 1.4
- See Also:
Searcher.search(Query,Filter,int,Sort),FieldCache
-
-
Constructor Summary
Constructors Constructor and Description FieldSortedHitQueue(IndexReader reader, SortField[] fields, int size)Creates a hit queue sorted by the given list of fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description floatgetMaxScore()returns the maximum score encountered by elements inserted via insert()booleaninsert(FieldDoc fdoc)booleaninsert(java.lang.Object fdoc)Adds element to the PriorityQueue in log(size) time if either the PriorityQueue is not full, or not lessThan(element, top()).java.lang.ObjectinsertWithOverflow(java.lang.Object element)insertWithOverflow() is the same as insert() except its return value: it returns the object (if any) that was dropped off the heap because it was full.
-
-
-
Constructor Detail
-
FieldSortedHitQueue
public FieldSortedHitQueue(IndexReader reader, SortField[] fields, int size) throws java.io.IOException
Creates a hit queue sorted by the given list of fields.- Parameters:
reader- Index to use.fields- Fieldable names, in priority order (highest priority first). Cannot benullor empty.size- The number of hits to retain. Must be greater than zero.- Throws:
java.io.IOException
-
-
Method Detail
-
getMaxScore
public float getMaxScore()
returns the maximum score encountered by elements inserted via insert()
-
insert
public boolean insert(FieldDoc fdoc)
-
insert
public boolean insert(java.lang.Object fdoc)
Description copied from class:PriorityQueueAdds element to the PriorityQueue in log(size) time if either the PriorityQueue is not full, or not lessThan(element, top()).- Overrides:
insertin classPriorityQueue- Returns:
- true if element is added, false otherwise.
-
insertWithOverflow
public java.lang.Object insertWithOverflow(java.lang.Object element)
Description copied from class:PriorityQueueinsertWithOverflow() is the same as insert() except its return value: it returns the object (if any) that was dropped off the heap because it was full. This can be the given parameter (in case it is smaller than the full heap's minimum, and couldn't be added), or another object that was previously the smallest value in the heap and now has been replaced by a larger one, or null if the queue wasn't yet full with maxSize elements.- Overrides:
insertWithOverflowin classPriorityQueue
-
-
DataMelt 3.0 © DataMelt by jWork.ORG