DocTermsIndexDocValues (Lucene 10.5.0 queries API)
Description: declaration: package: org.apache.lucene.queries.function.docvalues, class: DocTermsIndexDocValues

Package org.apache.lucene.queries.function.docvalues

# Class DocTermsIndexDocValues

java.lang.Object
org.apache.lucene.queries.function.FunctionValues
org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues

public abstract class DocTermsIndexDocValues extends FunctionValues
Serves as base class for FunctionValues based on DocTermsIndex.

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 final class`
  `DocTermsIndexDocValues.DocTermsIndexException`
  Custom Exception to be thrown when the DocTermsIndex for a field cannot be generated

  ## Nested classes/interfaces inherited from class org.apache.lucene.queries.function.FunctionValues

  `FunctionValues.ValueFiller`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final CharsRefBuilder`
  `spareChars`
  `protected final SortedDocValues`
  `termsIndex`
  `protected final MutableValueStr`
  `val`
  `protected final ValueSource`
  `vs`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `DocTermsIndexDocValues(ValueSource vs, LeafReaderContext context, String field)`
  `protected`
  `DocTermsIndexDocValues(ValueSource vs, SortedDocValues termsIndex)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `boolVal(int doc)`
  `boolean`
  `bytesVal(int doc, BytesRefBuilder target)`
  returns the bytes representation of the string val - TODO: should this return the indexed raw bytes not?
  `boolean`
  `exists(int doc)`
  Returns true if there is a value for this document
  `protected int`
  `getOrdForDoc(int doc)`
  `ValueSourceScorer`
  `getRangeScorer(LeafReaderContext readerContext, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper)`
  Yields a `Scorer` that matches documents with values between the specified range, and that which produces scores equal to `FunctionValues.floatVal(int)`.
  `FunctionValues.ValueFiller`
  `getValueFiller()`
  `int`
  `numOrd()`
  `abstract Object`
  `objectVal(int doc)`
  Native Java Object representation of the value
  `int`
  `ordVal(int doc)`
  `String`
  `strVal(int doc)`
  `String`
  `toString(int doc)`
  `protected abstract String`
  `toTerm(String readableValue)`

  ### Methods inherited from class org.apache.lucene.queries.function.FunctionValues

  `byteVal, byteVal, byteVectorVal, cost, doubleVal, doubleVal, explain, floatVal, floatVal, floatVectorVal, getScorer, intVal, intVal, longVal, longVal, shortVal, shortVal, strVal`

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

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

- ## Field Details

  - ### termsIndex

    protected final SortedDocValues termsIndex

  - ### vs

    protected final ValueSource vs

  - ### val

    protected final MutableValueStr val

  - ### spareChars

    protected final CharsRefBuilder spareChars

- ## Constructor Details

  - ### DocTermsIndexDocValues

    public DocTermsIndexDocValues(ValueSource vs, LeafReaderContext context, String field) throws IOException
    Throws:
      `IOException`

  - ### DocTermsIndexDocValues

    protected DocTermsIndexDocValues(ValueSource vs, SortedDocValues termsIndex)

- ## Method Details

  - ### getOrdForDoc

    protected int getOrdForDoc(int doc) throws IOException
    Throws:
      `IOException`

  - ### toTerm

    protected abstract String toTerm(String readableValue)

  - ### exists

    public boolean exists(int doc) throws IOException
    Description copied from class: `FunctionValues`
    Returns true if there is a value for this document
    Overrides:
      `exists` in class `FunctionValues`
    Throws:
      `IOException`

  - ### ordVal

    public int ordVal(int doc) throws IOException
    Overrides:
      `ordVal` in class `FunctionValues`
    Parameters:
      `doc` - The doc to retrieve to sort ordinal for
    Returns:
      the sort ordinal for the specified doc TODO: Maybe we can just use intVal for this...
    Throws:
      `IOException`

  - ### numOrd

    public int numOrd()
    Overrides:
      `numOrd` in class `FunctionValues`
    Returns:
      the number of unique sort ordinals this instance has

  - ### bytesVal

    public boolean bytesVal(int doc, BytesRefBuilder target) throws IOException
    Description copied from class: `FunctionValues`
    returns the bytes representation of the string val - TODO: should this return the indexed raw bytes not?
    Overrides:
      `bytesVal` in class `FunctionValues`
    Throws:
      `IOException`

  - ### strVal

    public String strVal(int doc) throws IOException
    Overrides:
      `strVal` in class `FunctionValues`
    Throws:
      `IOException`

  - ### boolVal

    public boolean boolVal(int doc) throws IOException
    Overrides:
      `boolVal` in class `FunctionValues`
    Throws:
      `IOException`

  - ### objectVal

    public abstract Object objectVal(int doc) throws IOException
    Description copied from class: `FunctionValues`
    Native Java Object representation of the value
    Overrides:
      `objectVal` in class `FunctionValues`
    Throws:
      `IOException`

  - ### getRangeScorer

    public ValueSourceScorer getRangeScorer(LeafReaderContext readerContext, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper) throws IOException
    Description copied from class: `FunctionValues`
    Yields a `Scorer` that matches documents with values between the specified range, and that which produces scores equal to `FunctionValues.floatVal(int)`.
    Overrides:
      `getRangeScorer` in class `FunctionValues`
    Throws:
      `IOException`

  - ### toString

    public String toString(int doc) throws IOException
    Specified by:
      `toString` in class `FunctionValues`
    Throws:
      `IOException`

  - ### getValueFiller

    public FunctionValues.ValueFiller getValueFiller()
    Overrides:
      `getValueFiller` in class `FunctionValues`