Class FunctionValues
java.lang.Object
org.apache.lucene.queries.function.FunctionValues
- Direct Known Subclasses:
BoolDocValues
,DocTermsIndexDocValues
,DoubleDocValues
,FloatDocValues
,IntDocValues
,LongDocValues
,MultiFunction.Values
,StrDocValues
,VectorFieldFunction
Represents field values as different types. Normally created via a
ValueSource
for a
particular field and reader.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Abstraction of the logic required to fill the value of a specified doc into a reusableMutableValue
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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?byte
byteVal
(int doc) void
byteVal
(int doc, byte[] vals) byte[]
byteVectorVal
(int doc) float
cost()
An estimate of the expected cost to return a value for a document.double
doubleVal
(int doc) void
doubleVal
(int doc, double[] vals) boolean
exists
(int doc) Returns true if there is a value for this documentexplain
(int doc) float
floatVal
(int doc) void
floatVal
(int doc, float[] vals) float[]
floatVectorVal
(int doc) getRangeScorer
(Weight weight, LeafReaderContext readerContext, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper) Yields aScorer
that matches documents with values between the specified range, and that which produces scores equal tofloatVal(int)
.getScorer
(Weight weight, LeafReaderContext readerContext) Yields aScorer
that matches all documents, and that which produces scores equal tofloatVal(int)
.int
intVal
(int doc) void
intVal
(int doc, int[] vals) long
longVal
(int doc) void
longVal
(int doc, long[] vals) int
numOrd()
objectVal
(int doc) Native Java Object representation of the valueint
ordVal
(int doc) short
shortVal
(int doc) void
shortVal
(int doc, short[] vals) strVal
(int doc) void
abstract String
toString
(int doc)
-
Constructor Details
-
FunctionValues
public FunctionValues()
-
-
Method Details
-
byteVal
- Throws:
IOException
-
shortVal
- Throws:
IOException
-
floatVal
- Throws:
IOException
-
intVal
- Throws:
IOException
-
longVal
- Throws:
IOException
-
doubleVal
- Throws:
IOException
-
strVal
- Throws:
IOException
-
boolVal
- Throws:
IOException
-
floatVectorVal
- Throws:
IOException
-
byteVectorVal
- Throws:
IOException
-
bytesVal
returns the bytes representation of the string val - TODO: should this return the indexed raw bytes not?- Throws:
IOException
-
objectVal
Native Java Object representation of the value- Throws:
IOException
-
exists
Returns true if there is a value for this document- Throws:
IOException
-
ordVal
- 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()- Returns:
- the number of unique sort ordinals this instance has
-
cost
public float cost()An estimate of the expected cost to return a value for a document. It's intended to be used by TwoPhaseIterator.matchCost implementations. Returns an expected cost in number of simple operations like addition, multiplication, comparing two numbers and indexing an array. The returned value must be positive. -
toString
- Throws:
IOException
-
getValueFiller
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
byteVal
- Throws:
IOException
-
shortVal
- Throws:
IOException
-
floatVal
- Throws:
IOException
-
intVal
- Throws:
IOException
-
longVal
- Throws:
IOException
-
doubleVal
- Throws:
IOException
-
strVal
- Throws:
IOException
-
explain
- Throws:
IOException
-
getScorer
Yields aScorer
that matches all documents, and that which produces scores equal tofloatVal(int)
. -
getRangeScorer
public ValueSourceScorer getRangeScorer(Weight weight, LeafReaderContext readerContext, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper) throws IOException Yields aScorer
that matches documents with values between the specified range, and that which produces scores equal tofloatVal(int)
.- Throws:
IOException
-