org.apache.lucene.index

## Class MultiDocValues.MultiSortedDocValues

- java.lang.Object
- - org.apache.lucene.index.BinaryDocValues
  - - org.apache.lucene.index.SortedDocValues
    - - org.apache.lucene.index.MultiDocValues.MultiSortedDocValues

- Enclosing class:
    MultiDocValues

      public static class MultiDocValues.MultiSortedDocValues
      extends SortedDocValues

  Implements SortedDocValues over n subs, using an OrdinalMap
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int[]` | `docStarts` docbase for each leaf: parallel with `values`
    `MultiDocValues.OrdinalMap` | `mapping` ordinal map mapping ords from `values` to global ord space
    `SortedDocValues[]` | `values` leaf values

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiSortedDocValues(SortedDocValues[] values, int[] docStarts, MultiDocValues.OrdinalMap mapping)` Creates a new MultiSortedDocValues over `values`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getOrd(int docID)` Returns the ordinal for the specified docID.
    `int` | `getValueCount()` Returns the number of unique values.
    `BytesRef` | `lookupOrd(int ord)` Retrieves the value for the specified ordinal.

    - ### Methods inherited from class org.apache.lucene.index.SortedDocValues

      `get, intersect, lookupTerm, termsEnum`

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

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

- - ### Field Detail

    - #### docStarts

          public final int[] docStarts

      docbase for each leaf: parallel with `values`

    - #### values

          public final SortedDocValues[] values

      leaf values

    - #### mapping

          public final MultiDocValues.OrdinalMap mapping

      ordinal map mapping ords from `values` to global ord space

  - ### Constructor Detail

    - #### MultiSortedDocValues

          public MultiSortedDocValues(SortedDocValues[] values,
                                      int[] docStarts,
                                      MultiDocValues.OrdinalMap mapping)
                               throws IOException

      Creates a new MultiSortedDocValues over `values`
      Throws:
        `IOException`

  - ### Method Detail

    - #### getOrd

          public int getOrd(int docID)

      Description copied from class: `SortedDocValues`
      Returns the ordinal for the specified docID.
      Specified by:
        `getOrd` in class `SortedDocValues`
      Parameters:
        `docID` - document ID to lookup
      Returns:
        ordinal for the document: this is dense, starts at 0, then increments by 1 for the next value in sorted order. Note that missing values are indicated by -1.

    - #### lookupOrd

          public BytesRef lookupOrd(int ord)

      Description copied from class: `SortedDocValues`
      Retrieves the value for the specified ordinal. The returned `BytesRef` may be re-used across calls to `SortedDocValues.lookupOrd(int)` so make sure to `copy it` if you want to keep it around.
      Specified by:
        `lookupOrd` in class `SortedDocValues`
      Parameters:
        `ord` - ordinal to lookup (must be >= 0 and < `SortedDocValues.getValueCount()`)
      See Also:
        `SortedDocValues.getOrd(int)`

    - #### getValueCount

          public int getValueCount()

      Description copied from class: `SortedDocValues`
      Returns the number of unique values.
      Specified by:
        `getValueCount` in class `SortedDocValues`
      Returns:
        number of unique values in this SortedDocValues. This is also equivalent to one plus the maximum ordinal.

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