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

Package org.apache.lucene.index

# Class MultiDocValues

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

public class MultiDocValues extends Object
A wrapper for CompositeIndexReader providing access to DocValues.

NOTE: for multi readers, you'll get better performance by gathering the sub readers using `IndexReader.getContext()` to get the atomic leaves and then operate per-LeafReader, instead of using this class.

NOTE: This is very costly.

WARNING: This API is experimental and might change in incompatible ways in the next release.
NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `MultiDocValues.MultiSortedDocValues`
  Implements SortedDocValues over n subs, using an OrdinalMap
  `static class`
  `MultiDocValues.MultiSortedSetDocValues`
  Implements MultiSortedSetDocValues over n subs, using an OrdinalMap

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static BinaryDocValues`
  `getBinaryValues(IndexReader r, String field)`
  Returns a BinaryDocValues for a reader's docvalues (potentially merging on-the-fly)
  `static NumericDocValues`
  `getNormValues(IndexReader r, String field)`
  Returns a NumericDocValues for a reader's norms (potentially merging on-the-fly).
  `static NumericDocValues`
  `getNumericValues(IndexReader r, String field)`
  Returns a NumericDocValues for a reader's docvalues (potentially merging on-the-fly)
  `static SortedNumericDocValues`
  `getSortedNumericValues(IndexReader r, String field)`
  Returns a SortedNumericDocValues for a reader's docvalues (potentially merging on-the-fly)
  `static SortedSetDocValues`
  `getSortedSetValues(IndexReader r, String field)`
  Returns a SortedSetDocValues for a reader's docvalues (potentially doing extremely slow things).
  `static SortedDocValues`
  `getSortedValues(IndexReader r, String field)`
  Returns a SortedDocValues for a reader's docvalues (potentially doing extremely slow things).

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

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

- ## Method Details

  - ### getNormValues

    public static NumericDocValues getNormValues(IndexReader r, String field) throws IOException
    Returns a NumericDocValues for a reader's norms (potentially merging on-the-fly).

    This is a slow way to access normalization values. Instead, access them per-segment with `LeafReader.getNormValues(String)`

    Throws:
      `IOException`

  - ### getNumericValues

    public static NumericDocValues getNumericValues(IndexReader r, String field) throws IOException
    Returns a NumericDocValues for a reader's docvalues (potentially merging on-the-fly)
    Throws:
      `IOException`

  - ### getBinaryValues

    public static BinaryDocValues getBinaryValues(IndexReader r, String field) throws IOException
    Returns a BinaryDocValues for a reader's docvalues (potentially merging on-the-fly)
    Throws:
      `IOException`

  - ### getSortedNumericValues

    public static SortedNumericDocValues getSortedNumericValues(IndexReader r, String field) throws IOException
    Returns a SortedNumericDocValues for a reader's docvalues (potentially merging on-the-fly)

    This is a slow way to access sorted numeric values. Instead, access them per-segment with `LeafReader.getSortedNumericDocValues(String)`

    Throws:
      `IOException`

  - ### getSortedValues

    public static SortedDocValues getSortedValues(IndexReader r, String field) throws IOException
    Returns a SortedDocValues for a reader's docvalues (potentially doing extremely slow things).

    This is an extremely slow way to access sorted values. Instead, access them per-segment with `LeafReader.getSortedDocValues(String)`

    Throws:
      `IOException`

  - ### getSortedSetValues

    public static SortedSetDocValues getSortedSetValues(IndexReader r, String field) throws IOException
    Returns a SortedSetDocValues for a reader's docvalues (potentially doing extremely slow things).

    This is an extremely slow way to access sorted values. Instead, access them per-segment with `LeafReader.getSortedSetDocValues(String)`

    Throws:
      `IOException`