Class SortedDocValues

    • Field Detail

    • Constructor Detail

      • SortedDocValues

        protected SortedDocValues()
        Sole constructor. (For invocation by subclass constructors, typically implicit.)
    • Method Detail

      • ordValue

        public abstract int ordValue()
                              throws java.io.IOException
        Returns the ordinal for the current docID. It is illegal to call this method after DocValuesIterator.advanceExact(int) returned false.
        Returns:
        ordinal for the document: this is dense, starts at 0, then increments by 1 for the next value in sorted order.
        Throws:
        java.io.IOException
      • lookupOrd

        public abstract BytesRef lookupOrd​(int ord)
                                    throws java.io.IOException
        Retrieves the value for the specified ordinal. The returned BytesRef may be re-used across calls to lookupOrd(int) so make sure to copy it if you want to keep it around.
        Parameters:
        ord - ordinal to lookup (must be >= 0 and < getValueCount())
        Throws:
        java.io.IOException
        See Also:
        ordValue()
      • getValueCount

        public abstract int getValueCount()
        Returns the number of unique values.
        Returns:
        number of unique values in this SortedDocValues. This is also equivalent to one plus the maximum ordinal.
      • lookupTerm

        public int lookupTerm​(BytesRef key)
                       throws java.io.IOException
        If key exists, returns its ordinal, else returns -insertionPoint-1, like Arrays.binarySearch.
        Parameters:
        key - Key to look up
        Throws:
        java.io.IOException