Class FieldValueHitQueue<T extends FieldValueHitQueue.Entry>

    • Field Detail

      • fields

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

        protected final int[] reverseMul
    • Constructor Detail

      • FieldValueHitQueue

        private FieldValueHitQueue​(SortField[] fields,
                                   int size)
    • Method Detail

      • create

        public static <T extends FieldValueHitQueue.EntryFieldValueHitQueue<T> create​(SortField[] fields,
                                                                                        int size)
        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.
      • getReverseMul

        public int[] getReverseMul()
      • fillFields

        FieldDoc fillFields​(FieldValueHitQueue.Entry entry)
        Given a queue Entry, creates a corresponding FieldDoc that contains 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.
        Parameters:
        entry - The Entry used to create a FieldDoc
        Returns:
        The newly created FieldDoc
        See Also:
        IndexSearcher.search(Query,int,Sort)
      • getFields

        SortField[] getFields()
        Returns the SortFields being used by this hit queue.