DocValuesSkipper (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.index, class: DocValuesSkipper

Package org.apache.lucene.index

# Class DocValuesSkipper

java.lang.Object
org.apache.lucene.index.DocValuesSkipper

public abstract class DocValuesSkipper extends Object
Skipper for `DocValues`.

A skipper has a position that can only be advanced via `advance(int)`. The next advance position must be greater than `maxDocID(int)` at level 0. A skipper's position, along with a `level`, determines the interval at which the skipper is currently situated.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DocValuesSkipper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `advance(int target)`
  Advance this skipper so that all levels contain the next document on or after `target`.
  `final void`
  `advance(long minValue, long maxValue)`
  Advance this skipper so that all levels intersects the range given by `minValue` and `maxValue`.
  `abstract int`
  `docCount()`
  Return the global number of documents with a value for the field.
  `abstract int`
  `docCount(int level)`
  Return the number of documents that have a value in the interval associated with the given level.
  `static int`
  `globalDocCount(IndexReader reader, String field)`
  Returns the total skipper document count for a field across all segments
  `static long`
  `globalMaxValue(IndexReader reader, String field)`
  Returns the maximum value for a field across all segments, or `Long.MIN_VALUE` if not available
  `static long`
  `globalMinValue(IndexReader reader, String field)`
  Returns the minimum value for a field across all segments, or `Long.MIN_VALUE` if not available
  `abstract int`
  `maxDocID(int level)`
  Return the maximum doc ID of the interval on the given level, inclusive.
  `abstract long`
  `maxValue()`
  Return the global maximum value.
  `abstract long`
  `maxValue(int level)`
  Return the maximum value of the interval at the given level, inclusive.
  `int`
  `maxValueCount()`
  Return the global maximum number of values that any single document has for the field.
  `abstract int`
  `minDocID(int level)`
  Return the minimum doc ID of the interval on the given level, inclusive.
  `abstract long`
  `minValue()`
  Return the global minimum value.
  `abstract long`
  `minValue(int level)`
  Return the minimum value of the interval at the given level, inclusive.
  `abstract int`
  `numLevels()`
  Return the number of levels.

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

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

- ## Constructor Details

  - ### DocValuesSkipper

    public DocValuesSkipper()

- ## Method Details

  - ### advance

    public abstract void advance(int target) throws IOException
    Advance this skipper so that all levels contain the next document on or after `target`.

    NOTE: The behavior is undefined if `target` is less than or equal to `maxDocID(0)`.

    NOTE: `minDocID(0)` may return a doc ID that is greater than `target` if the target document doesn't have a value.

    Throws:
      `IOException`

  - ### numLevels

    public abstract int numLevels()
    Return the number of levels. This number may change when moving to a different interval.

  - ### minDocID

    public abstract int minDocID(int level)
    Return the minimum doc ID of the interval on the given level, inclusive. This returns `-1` if `advance(int)` has not been called yet and `DocIdSetIterator.NO_MORE_DOCS` if the iterator is exhausted. This method is non-increasing when `level` increases. Said otherwise `minDocID(level+1) <= minDocId(level)`.

  - ### maxDocID

    public abstract int maxDocID(int level)
    Return the maximum doc ID of the interval on the given level, inclusive. This returns `-1` if `advance(int)` has not been called yet and `DocIdSetIterator.NO_MORE_DOCS` if the iterator is exhausted. This method is non-decreasing when `level` decreases. Said otherwise `maxDocID(level+1) >= maxDocId(level)`.

  - ### minValue

    public abstract long minValue(int level)
    Return the minimum value of the interval at the given level, inclusive.

    NOTE: It is only guaranteed that values in this interval are greater than or equal the returned value. There is no guarantee that one document actually has this value.

  - ### maxValue

    public abstract long maxValue(int level)
    Return the maximum value of the interval at the given level, inclusive.

    NOTE: It is only guaranteed that values in this interval are less than or equal the returned value. There is no guarantee that one document actually has this value.

  - ### docCount

    public abstract int docCount(int level)
    Return the number of documents that have a value in the interval associated with the given level.

  - ### minValue

    public abstract long minValue()
    Return the global minimum value.

    NOTE: It is only guaranteed that values are greater than or equal the returned value. There is no guarantee that one document actually has this value.

  - ### maxValue

    public abstract long maxValue()
    Return the global maximum value.

    NOTE: It is only guaranteed that values are less than or equal the returned value. There is no guarantee that one document actually has this value.

  - ### docCount

    public abstract int docCount()
    Return the global number of documents with a value for the field.

  - ### maxValueCount

    public int maxValueCount()
    Return the global maximum number of values that any single document has for the field. Returns `-1` if the exact value is unavailable (e.g., the segment was written by an older codec that did not persist this metadata and it could not be inferred from other metadata).

    This returns `0` if `docCount()` is `0`. A field is known to be single-valued if this method returns `1`.

  - ### advance

    public final void advance(long minValue, long maxValue) throws IOException
    Advance this skipper so that all levels intersects the range given by `minValue` and `maxValue`. If there are no intersecting levels, the skipper is exhausted.
    Throws:
      `IOException`

  - ### globalMinValue

    public static long globalMinValue(IndexReader reader, String field) throws IOException
    Returns the minimum value for a field across all segments, or `Long.MIN_VALUE` if not available
    Parameters:
      `reader` - the index reader to be queried
      `field` - the field to retrieve values for
    Throws:
      `IOException`

  - ### globalMaxValue

    public static long globalMaxValue(IndexReader reader, String field) throws IOException
    Returns the maximum value for a field across all segments, or `Long.MIN_VALUE` if not available
    Parameters:
      `reader` - the index reader to be queried
      `field` - the field to retrieve values for
    Throws:
      `IOException`

  - ### globalDocCount

    public static int globalDocCount(IndexReader reader, String field) throws IOException
    Returns the total skipper document count for a field across all segments
    Parameters:
      `reader` - the index reader to be queried
      `field` - the field to retrieve values for
    Throws:
      `IOException`