## org.apache.lucene.search
Class FieldSortedHitQueue

    java.lang.Object
      org.apache.lucene.util.PriorityQueue
          org.apache.lucene.search.FieldSortedHitQueue

Deprecated. see `FieldValueHitQueue`

    public class FieldSortedHitQueue

extends PriorityQueue

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

Since:
  lucene 1.4
Version:
  $Id: FieldSortedHitQueue.java 811070 2009-09-03 18:31:41Z hossman $
See Also:
  `Searcher.search(Query,Filter,int,Sort)`, `FieldCache`

Field Summary
`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.

Fields inherited from class org.apache.lucene.util.PriorityQueue
`heap`

Constructor Summary
`FieldSortedHitQueue(IndexReader reader, SortField[] fields, int size)` Deprecated. Creates a hit queue sorted by the given list of fields.

Method Summary
`float` `getMaxScore()` Deprecated. returns the maximum score encountered by elements inserted via insert()
`boolean` `insert(FieldDoc fdoc)` Deprecated.
`boolean` `insert(java.lang.Object fdoc)` Deprecated. Adds element to the PriorityQueue in log(size) time if either the PriorityQueue is not full, or not lessThan(element, top()).
`java.lang.Object` `insertWithOverflow(java.lang.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(java.lang.Object a, java.lang.Object b)` Deprecated. Returns whether `a` is less relevant than `b`.

Methods inherited from class org.apache.lucene.util.PriorityQueue
`add, adjustTop, clear, getSentinelObject, initialize, pop, put, size, top, updateTop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### comparators

    protected ScoreDocComparator[] comparators

  Deprecated.
  Stores a comparator corresponding to each field being sorted by

### fields

    protected SortField[] fields

  Deprecated.
  Stores the sort criteria being used.

### maxscore

    protected float maxscore

  Deprecated.
  Stores the maximum score value encountered, needed for normalizing.

Constructor Detail

### FieldSortedHitQueue

    public FieldSortedHitQueue(IndexReader reader,
                               SortField[] fields,
                               int size)
                        throws java.io.IOException

  Deprecated.
  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:
    `java.io.IOException`

Method Detail

### getMaxScore

    public float getMaxScore()

  Deprecated.
  returns the maximum score encountered by elements inserted via insert()

### insert

    public boolean insert(FieldDoc fdoc)

  Deprecated.

### insert

    public boolean insert(java.lang.Object fdoc)

  Deprecated.
  Description copied from class: `PriorityQueue`
  Adds element to the PriorityQueue in log(size) time if either the PriorityQueue is not full, or not lessThan(element, top()).

  Overrides:
    `insert` in class `PriorityQueue`
  Returns:
    true if element is added, false otherwise.

### insertWithOverflow

    public java.lang.Object insertWithOverflow(java.lang.Object element)

  Deprecated.
  Description copied from class: `PriorityQueue`
  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. This can be the given parameter (in case it is smaller than the full heap's minimum, and couldn't be added), or another object that was previously the smallest value in the heap and now has been replaced by a larger one, or null if the queue wasn't yet full with maxSize elements.

  Overrides:
    `insertWithOverflow` in class `PriorityQueue`

### lessThan

    protected boolean lessThan(java.lang.Object a,
                               java.lang.Object b)

  Deprecated.
  Returns whether `a` is less relevant than `b`.

  Specified by:
    `lessThan` in class `PriorityQueue`
  Parameters:
    `a` - ScoreDoc
    `b` - ScoreDoc
  Returns:
    `true` if document `a` should be sorted after document `b`.

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