org.apache.lucene.search
Class FieldValueHitQueue

java.lang.Object
  extended by org.apache.lucene.util.PriorityQueue<org.apache.lucene.search.FieldValueHitQueue.Entry>
      extended by org.apache.lucene.search.FieldValueHitQueue

public abstract class FieldValueHitQueue
extends PriorityQueue<org.apache.lucene.search.FieldValueHitQueue.Entry>

Expert: A hit queue for sorting by hits by terms in more than one field. Uses FieldCache.DEFAULT for maintaining internal term lookup tables. NOTE: This API is experimental and might change in incompatible ways in the next release.

Since:
2.9
Version:
$Id:
See Also:
Searcher.search(Query,Filter,int,Sort), FieldCache

Field Summary
protected  FieldComparator[] comparators
           
protected  SortField[] fields
          Stores the sort criteria being used.
protected  int[] reverseMul
           
 
Fields inherited from class org.apache.lucene.util.PriorityQueue
heap
 
Method Summary
static FieldValueHitQueue create(SortField[] fields, int size)
          Creates a hit queue sorted by the given list of fields.
protected abstract  boolean lessThan(org.apache.lucene.search.FieldValueHitQueue.Entry a, org.apache.lucene.search.FieldValueHitQueue.Entry b)
          Determines the ordering of objects in this priority queue.
 
Methods inherited from class org.apache.lucene.util.PriorityQueue
add, clear, getSentinelObject, initialize, insertWithOverflow, pop, size, top, updateTop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fields

protected final SortField[] fields
Stores the sort criteria being used.


comparators

protected final FieldComparator[] comparators

reverseMul

protected final int[] reverseMul
Method Detail

create

public static FieldValueHitQueue create(SortField[] fields,
                                        int size)
                                 throws IOException
Creates a hit queue sorted by the given list of fields.

NOTE: The instances returned by this method pre-allocate a full array of length numHits.

Parameters:
fields - SortField array we are sorting by 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

lessThan

protected abstract boolean lessThan(org.apache.lucene.search.FieldValueHitQueue.Entry a,
                                    org.apache.lucene.search.FieldValueHitQueue.Entry b)
Description copied from class: PriorityQueue
Determines the ordering of objects in this priority queue. Subclasses must define this one method.

Specified by:
lessThan in class PriorityQueue<org.apache.lucene.search.FieldValueHitQueue.Entry>


Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.