DocValuesRangeIterator (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.search, class: DocValuesRangeIterator

Package org.apache.lucene.search

# Class DocValuesRangeIterator

java.lang.Object
org.apache.lucene.search.TwoPhaseIterator
org.apache.lucene.search.DocValuesRangeIterator

public abstract sealed class DocValuesRangeIterator extends TwoPhaseIterator
A `TwoPhaseIterator` over doc values that skips documents with values that lie outside a specific range, using a `SkipBlockRangeIterator` as an approximation

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.search.TwoPhaseIterator

  `approximation`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DocValuesRangeIterator`
  `forOrdinalRange(SortedDocValues values, DocValuesSkipper skipper, long min, long max)`
  Creates a DocValuesRangeIterator over a SortedDocValues instance
  `static DocValuesRangeIterator`
  `forOrdinalRange(SortedSetDocValues values, DocValuesSkipper skipper, long min, long max)`
  Creates a DocValuesRangeIterator over a SortedSetDocValues instance
  `static DocValuesRangeIterator`
  `forOrdinalSet(SortedDocValues values, DocValuesSkipper skipper, TermsEnum terms)`
  Creates a DocValuesRangeIterator over a SortedDocValues instance
  `static DocValuesRangeIterator`
  `forOrdinalSet(SortedSetDocValues values, DocValuesSkipper skipper, long minOrd, long maxOrd, LongBitSet ords)`
  Creates a DocValuesRangeIterator over a SortedSetDocValues instance
  `static DocValuesRangeIterator`
  `forOrdinalSet(SortedSetDocValues values, DocValuesSkipper skipper, TermsEnum terms)`
  Creates a DocValuesRangeIterator over a SortedSetDocValues instance
  `static DocValuesRangeIterator`
  `forRange(NumericDocValues values, DocValuesSkipper skipper, long min, long max)`
  Creates a DocValuesRangeIterator over a NumericDocValues instance
  `static DocValuesRangeIterator`
  `forRange(SortedNumericDocValues values, DocValuesSkipper skipper, long min, long max)`
  Creates a DocValuesRangeIterator over a SortedNumericDocValues instance

  ### Methods inherited from class org.apache.lucene.search.TwoPhaseIterator

  `approximation, asDocIdSetIterator, docIDRunEnd, intoBitSet, matchCost, matches, unwrap`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### forRange

    public static DocValuesRangeIterator forRange(NumericDocValues values, DocValuesSkipper skipper, long min, long max)
    Creates a DocValuesRangeIterator over a NumericDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `min` - skip documents with values lower than this
      `max` - skip documents with values higher than this

  - ### forRange

    public static DocValuesRangeIterator forRange(SortedNumericDocValues values, DocValuesSkipper skipper, long min, long max)
    Creates a DocValuesRangeIterator over a SortedNumericDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `min` - skip documents with all values lower than this
      `max` - skip documents with all values higher than this

  - ### forOrdinalRange

    public static DocValuesRangeIterator forOrdinalRange(SortedDocValues values, DocValuesSkipper skipper, long min, long max)
    Creates a DocValuesRangeIterator over a SortedDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `min` - skip documents with ordinal values lower than this
      `max` - skip documents with ordinal values higher than this

  - ### forOrdinalRange

    public static DocValuesRangeIterator forOrdinalRange(SortedSetDocValues values, DocValuesSkipper skipper, long min, long max)
    Creates a DocValuesRangeIterator over a SortedSetDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `min` - skip documents with all ordinal values lower than this
      `max` - skip documents with all ordinal values higher than this

  - ### forOrdinalSet

    public static DocValuesRangeIterator forOrdinalSet(SortedDocValues values, DocValuesSkipper skipper, TermsEnum terms) throws IOException
    Creates a DocValuesRangeIterator over a SortedDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `terms` - a TermsEnum containing the ordinal values to match
    Throws:
      `IOException`

  - ### forOrdinalSet

    public static DocValuesRangeIterator forOrdinalSet(SortedSetDocValues values, DocValuesSkipper skipper, TermsEnum terms) throws IOException
    Creates a DocValuesRangeIterator over a SortedSetDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `terms` - a TermsEnum containing the ordinal values to match
    Throws:
      `IOException`

  - ### forOrdinalSet

    public static DocValuesRangeIterator forOrdinalSet(SortedSetDocValues values, DocValuesSkipper skipper, long minOrd, long maxOrd, LongBitSet ords)
    Creates a DocValuesRangeIterator over a SortedSetDocValues instance
    Parameters:
      `values` - the doc values
      `skipper` - an optional skipper to exclude non-matching blocks
      `minOrd` - skip documents with all ordinal values lower than this
      `maxOrd` - skip documents with all ordinal values higher than this
      `ords` - skip documents with all values not in this set