|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.lucene.util.PriorityQueue
org.apache.lucene.search.FieldSortedHitQueue
Expert: A hit queue for sorting by hits by terms in more than one field.
Uses FieldCache.DEFAULT for maintaining internal term lookup tables.
Created: Dec 8, 2003 12:56:03 PM
Searcher.search(Query,Filter,int,Sort),
FieldCache| Field Summary | |
protected ScoreDocComparator[] |
comparators
Stores a comparator corresponding to each field being sorted by |
protected SortField[] |
fields
Stores the sort criteria being used. |
protected float |
maxscore
Stores the maximum score value encountered, needed for normalizing. |
| Constructor Summary | |
FieldSortedHitQueue(IndexReader reader,
SortField[] fields,
int size)
Creates a hit queue sorted by the given list of fields. |
|
| Method Summary | |
float |
getMaxScore()
returns the maximum score encountered by elements inserted via insert() |
boolean |
insert(FieldDoc fdoc)
|
boolean |
insert(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()). |
protected boolean |
lessThan(java.lang.Object a,
java.lang.Object b)
Returns whether a is less relevant than b. |
| Methods inherited from class org.apache.lucene.util.PriorityQueue |
adjustTop, clear, initialize, pop, put, size, top |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ScoreDocComparator[] comparators
protected SortField[] fields
protected float maxscore
| Constructor Detail |
public FieldSortedHitQueue(IndexReader reader,
SortField[] fields,
int size)
throws java.io.IOException
reader - Index to use.fields - Field names, in priority order (highest priority first). Cannot be null or empty.size - The number of hits to retain. Must be greater than zero.
java.io.IOException| Method Detail |
public float getMaxScore()
public boolean insert(FieldDoc fdoc)
public boolean insert(java.lang.Object fdoc)
PriorityQueue
insert in class PriorityQueuefdoc -
protected boolean lessThan(java.lang.Object a,
java.lang.Object b)
a is less relevant than b.
lessThan in class PriorityQueuea - ScoreDocb - ScoreDoc
true if document a should be sorted after document b.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||