Class FunctionValues
- java.lang.Object
-
- org.apache.lucene.queries.function.FunctionValues
-
- Direct Known Subclasses:
BoolDocValues,DocTermsIndexDocValues,DoubleDocValues,FloatDocValues,IntDocValues,LongDocValues,MultiFunction.Values,StrDocValues
public abstract class FunctionValues extends java.lang.ObjectRepresents field values as different types. Normally created via aValueSourcefor a particular field and reader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFunctionValues.ValueFillerAbstraction of the logic required to fill the value of a specified doc into a reusableMutableValue.
-
Constructor Summary
Constructors Constructor Description FunctionValues()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanboolVal(int doc)booleanbytesVal(int doc, BytesRefBuilder target)returns the bytes representation of the string val - TODO: should this return the indexed raw bytes not?bytebyteVal(int doc)voidbyteVal(int doc, byte[] vals)doubledoubleVal(int doc)voiddoubleVal(int doc, double[] vals)booleanexists(int doc)Returns true if there is a value for this documentExplanationexplain(int doc)floatfloatVal(int doc)voidfloatVal(int doc, float[] vals)ValueSourceScorergetRangeScorer(Weight weight, LeafReaderContext readerContext, java.lang.String lowerVal, java.lang.String upperVal, boolean includeLower, boolean includeUpper)Yields aScorerthat matches documents with values between the specified range, and that which produces scores equal tofloatVal(int).ValueSourceScorergetScorer(Weight weight, LeafReaderContext readerContext)Yields aScorerthat matches all documents, and that which produces scores equal tofloatVal(int).FunctionValues.ValueFillergetValueFiller()intintVal(int doc)voidintVal(int doc, int[] vals)longlongVal(int doc)voidlongVal(int doc, long[] vals)intnumOrd()java.lang.ObjectobjectVal(int doc)Native Java Object representation of the valueintordVal(int doc)shortshortVal(int doc)voidshortVal(int doc, short[] vals)java.lang.StringstrVal(int doc)voidstrVal(int doc, java.lang.String[] vals)abstract java.lang.StringtoString(int doc)
-
-
-
Method Detail
-
byteVal
public byte byteVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
shortVal
public short shortVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
floatVal
public float floatVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
intVal
public int intVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
longVal
public long longVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
doubleVal
public double doubleVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
strVal
public java.lang.String strVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
boolVal
public boolean boolVal(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
bytesVal
public boolean bytesVal(int doc, BytesRefBuilder target) throws java.io.IOExceptionreturns the bytes representation of the string val - TODO: should this return the indexed raw bytes not?- Throws:
java.io.IOException
-
objectVal
public java.lang.Object objectVal(int doc) throws java.io.IOExceptionNative Java Object representation of the value- Throws:
java.io.IOException
-
exists
public boolean exists(int doc) throws java.io.IOExceptionReturns true if there is a value for this document- Throws:
java.io.IOException
-
ordVal
public int ordVal(int doc) throws java.io.IOException- 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:
java.io.IOException
-
numOrd
public int numOrd()
- Returns:
- the number of unique sort ordinals this instance has
-
toString
public abstract java.lang.String toString(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
getValueFiller
public FunctionValues.ValueFiller getValueFiller()
-
byteVal
public void byteVal(int doc, byte[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
shortVal
public void shortVal(int doc, short[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
floatVal
public void floatVal(int doc, float[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
intVal
public void intVal(int doc, int[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
longVal
public void longVal(int doc, long[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
doubleVal
public void doubleVal(int doc, double[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
strVal
public void strVal(int doc, java.lang.String[] vals) throws java.io.IOException- Throws:
java.io.IOException
-
explain
public Explanation explain(int doc) throws java.io.IOException
- Throws:
java.io.IOException
-
getScorer
public ValueSourceScorer getScorer(Weight weight, LeafReaderContext readerContext)
Yields aScorerthat matches all documents, and that which produces scores equal tofloatVal(int).
-
getRangeScorer
public ValueSourceScorer getRangeScorer(Weight weight, LeafReaderContext readerContext, java.lang.String lowerVal, java.lang.String upperVal, boolean includeLower, boolean includeUpper) throws java.io.IOException
Yields aScorerthat matches documents with values between the specified range, and that which produces scores equal tofloatVal(int).- Throws:
java.io.IOException
-
-