Save This Page
Home » lucene-2.4.1-src » org.apache » lucene » search » [javadoc | source]
org.apache.lucene.search
public class: FieldSortedHitQueue [javadoc | source]
java.lang.Object
   org.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

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. 
static final  FieldCacheImpl.Cache Comparators    Internal cache of comparators. Similar to FieldCache, only caches comparators instead of term values. 
Fields inherited from org.apache.lucene.util.PriorityQueue:
heap
Constructor:
 public FieldSortedHitQueue(IndexReader reader,
    SortField[] fields,
    int size) throws 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 be null or empty.
    size - The number of hits to retain. Must be greater than zero.
    Throws:
    IOException -
Method from org.apache.lucene.search.FieldSortedHitQueue Summary:
comparatorAuto,   comparatorByte,   comparatorDouble,   comparatorFloat,   comparatorInt,   comparatorLong,   comparatorShort,   comparatorString,   comparatorStringLocale,   fillFields,   getCachedComparator,   getFields,   getMaxScore,   insert,   insert,   insertWithOverflow,   lessThan
Methods from org.apache.lucene.util.PriorityQueue:
adjustTop,   clear,   initialize,   insert,   insertWithOverflow,   lessThan,   pop,   put,   size,   top
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.FieldSortedHitQueue Detail:
 static ScoreDocComparator comparatorAuto(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to values in the given field. The terms in the field are looked at to determine whether they contain integers, floats or strings. Once the type is determined, one of the other static methods in this class is called to get the comparator.
 static ScoreDocComparator comparatorByte(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing bytes.
 static ScoreDocComparator comparatorDouble(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing doubles.
 static ScoreDocComparator comparatorFloat(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing floats.
 static ScoreDocComparator comparatorInt(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing integers.
 static ScoreDocComparator comparatorLong(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing integers.
 static ScoreDocComparator comparatorShort(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing shorts.
 static ScoreDocComparator comparatorString(IndexReader reader,
    String fieldname) throws IOException 
    Returns a comparator for sorting hits according to a field containing strings.
 static ScoreDocComparator comparatorStringLocale(IndexReader reader,
    String fieldname,
    Locale locale) throws IOException 
    Returns a comparator for sorting hits according to a field containing strings.
 FieldDoc fillFields(FieldDoc doc) 
    Given a FieldDoc object, stores the values used to sort the given document. These values are not the raw values out of the index, but the internal representation of them. This is so the given search hit can be collated by a MultiSearcher with other search hits.
 static ScoreDocComparator getCachedComparator(IndexReader reader,
    String field,
    int type,
    Locale locale,
    SortComparatorSource factory) throws IOException 
 SortField[] getFields() 
    Returns the SortFields being used by this hit queue.
 public float getMaxScore() 
    returns the maximum score encountered by elements inserted via insert()
 public boolean insert(FieldDoc fdoc) 
 public boolean insert(Object fdoc) 
 public Object insertWithOverflow(Object element) 
 protected boolean lessThan(Object a,
    Object b) 
    Returns whether a is less relevant than b.