public class FieldSortedHitQueue extends PriorityQueue
FieldCache.DEFAULT for maintaining internal term lookup tables.
Created: Dec 8, 2003 12:56:03 PM
Searcher.search(Query,Filter,int,Sort),
FieldCache| Modifier and Type | Field and Description |
|---|---|
protected ScoreDocComparator[] |
comparators
Deprecated.
Stores a comparator corresponding to each field being sorted by
|
protected SortField[] |
fields
Deprecated.
Stores the sort criteria being used.
|
protected float |
maxscore
Deprecated.
Stores the maximum score value encountered, needed for normalizing.
|
heap| Constructor and Description |
|---|
FieldSortedHitQueue(IndexReader reader,
SortField[] fields,
int size)
Deprecated.
Creates a hit queue sorted by the given list of fields.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getMaxScore()
Deprecated.
returns the maximum score encountered by elements inserted via insert()
|
boolean |
insert(FieldDoc fdoc)
Deprecated.
|
boolean |
insert(Object fdoc)
Deprecated.
Adds element to the PriorityQueue in log(size) time if either the
PriorityQueue is not full, or not lessThan(element, top()).
|
Object |
insertWithOverflow(Object element)
Deprecated.
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.
|
protected boolean |
lessThan(Object a,
Object b)
Deprecated.
Returns whether
a is less relevant than b. |
add, adjustTop, clear, getSentinelObject, initialize, pop, put, size, top, updateTopprotected ScoreDocComparator[] comparators
protected SortField[] fields
protected float maxscore
public FieldSortedHitQueue(IndexReader reader, SortField[] fields, int size) throws IOException
reader - Index to use.fields - Fieldable names, in priority order (highest priority first). Cannot be null or empty.size - The number of hits to retain. Must be greater than zero.IOExceptionpublic float getMaxScore()
public boolean insert(FieldDoc fdoc)
public boolean insert(Object fdoc)
PriorityQueueinsert in class PriorityQueuepublic Object insertWithOverflow(Object element)
PriorityQueueinsertWithOverflow in class PriorityQueueprotected boolean lessThan(Object a, Object b)
a is less relevant than b.lessThan in class PriorityQueuea - ScoreDocb - ScoreDoctrue if document a should be sorted after document b.Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.