org.apache.lucene.search.function

## Class DocValues

- java.lang.Object
- - org.apache.lucene.search.function.DocValues

-     public abstract class DocValues
      extends java.lang.Object

  Expert: represents field values as different types. Normally created via a `ValueSuorce` for a particular field and reader.

  WARNING: The status of the search.function package is experimental. The APIs introduced here might change in the future and will not be supported anymore in such a case.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocValues()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `doubleVal(int doc)` Return doc value as a double.
    `Explanation` | `explain(int doc)` Explain the scoring value for the input doc.
    `abstract float` | `floatVal(int doc)` Return doc value as a float.
    `float` | `getAverageValue()` Returns the average of all values or `Float.NaN` if this DocValues instance does not contain any value.
    `float` | `getMaxValue()` Returns the maximum of all values or `Float.NaN` if this DocValues instance does not contain any value.
    `float` | `getMinValue()` Returns the minimum of all values or `Float.NaN` if this DocValues instance does not contain any value.
    `int` | `intVal(int doc)` Return doc value as an int.
    `long` | `longVal(int doc)` Return doc value as a long.
    `java.lang.String` | `strVal(int doc)` Return doc value as a string.
    `abstract java.lang.String` | `toString(int doc)` Return a string representation of a doc value, as required for Explanations.

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

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

- - ### Constructor Detail

    - #### DocValues

          public DocValues()

  - ### Method Detail

    - #### floatVal

          public abstract float floatVal(int doc)

      Return doc value as a float.

      Mandatory: every DocValues implementation must implement at least this method.

      Parameters:
        `doc` - document whose float value is requested.

    - #### intVal

          public int intVal(int doc)

      Return doc value as an int.

      Optional: DocValues implementation can (but don't have to) override this method.

      Parameters:
        `doc` - document whose int value is requested.

    - #### longVal

          public long longVal(int doc)

      Return doc value as a long.

      Optional: DocValues implementation can (but don't have to) override this method.

      Parameters:
        `doc` - document whose long value is requested.

    - #### doubleVal

          public double doubleVal(int doc)

      Return doc value as a double.

      Optional: DocValues implementation can (but don't have to) override this method.

      Parameters:
        `doc` - document whose double value is requested.

    - #### strVal

          public java.lang.String strVal(int doc)

      Return doc value as a string.

      Optional: DocValues implementation can (but don't have to) override this method.

      Parameters:
        `doc` - document whose string value is requested.

    - #### toString

          public abstract java.lang.String toString(int doc)

      Return a string representation of a doc value, as required for Explanations.

    - #### explain

          public Explanation explain(int doc)

      Explain the scoring value for the input doc.

    - #### getMinValue

          public float getMinValue()

      Returns the minimum of all values or `Float.NaN` if this DocValues instance does not contain any value.

      This operation is optional

      Returns:
        the minimum of all values or `Float.NaN` if this DocValues instance does not contain any value.

    - #### getMaxValue

          public float getMaxValue()

      Returns the maximum of all values or `Float.NaN` if this DocValues instance does not contain any value.

      This operation is optional

      Returns:
        the maximum of all values or `Float.NaN` if this DocValues instance does not contain any value.

    - #### getAverageValue

          public float getAverageValue()

      Returns the average of all values or `Float.NaN` if this DocValues instance does not contain any value. *

      This operation is optional

      Returns:
        the average of all values or `Float.NaN` if this DocValues instance does not contain any value

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