org.apache.lucene.search
Class FieldSortedHitQueue
public class 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
$Id: FieldSortedHitQueue.java 477084 2006-11-20 07:10:04Z otis $- Tim Jones (Nacimiento Software)
float | getMaxScore() - returns the maximum score encountered by elements inserted via insert()
|
boolean | insert(Object fdoc)
|
boolean | insert(FieldDoc fdoc)
|
protected boolean | lessThan(Object a, Object b) - Returns whether
a is less relevant than b .
|
comparators
protected ScoreDocComparator[] comparators
Stores a comparator corresponding to each field being sorted by
fields
protected SortField[] fields
Stores the sort criteria being used.
maxscore
protected float maxscore
Stores the maximum score value encountered, needed for normalizing.
FieldSortedHitQueue
public FieldSortedHitQueue(IndexReader reader,
SortField[] fields,
int size)
throws IOException
Creates a hit queue sorted by the given list of fields.
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.
getMaxScore
public float getMaxScore()
returns the maximum score encountered by elements inserted via insert()
insert
public boolean insert(FieldDoc fdoc)
lessThan
protected boolean lessThan(Object a,
Object b)
Returns whether a
is less relevant than b
.
- lessThan in interface PriorityQueue
true
if document a
should be sorted after document b
.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.