org.apache.lucene.search.function

Class DocValues

public abstract class DocValues extends 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.

Author: yonik

Constructor Summary
DocValues(int nVals)
Constructor with input number of values(docs).
Method Summary
doubledoubleVal(int doc)
Return doc value as a double.
Explanationexplain(int doc)
Explain the scoring value for the input doc.
abstract floatfloatVal(int doc)
Return doc value as a float.
floatgetAverageValue()
Returns the average of all values.
floatgetMaxValue()
Optional op.
floatgetMinValue()
Optional op.
intintVal(int doc)
Return doc value as an int.
longlongVal(int doc)
Return doc value as a long.
StringstrVal(int doc)
Return doc value as a string.
abstract StringtoString(int doc)
Return a string representation of a doc value, as reuired for Explanations.

Constructor Detail

DocValues

public DocValues(int nVals)
Constructor with input number of values(docs).

Parameters: nVals

Method Detail

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.

explain

public Explanation explain(int doc)
Explain the scoring value for the input doc.

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.

getAverageValue

public float getAverageValue()
Returns the average of all values.

getMaxValue

public float getMaxValue()
Optional op. Returns the maximum of all values.

getMinValue

public float getMinValue()
Optional op. Returns the minimum of all values.

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.

strVal

public 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 String toString(int doc)
Return a string representation of a doc value, as reuired for Explanations.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.