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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDocTermsIndexDocValues.DocTermsIndexExceptionCustom 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 private intlastDocIDprotected CharsRefBuilderspareCharsprotected SortedDocValuestermsIndexprotected MutableValueStrvalprotected ValueSourcevs
-
Constructor Summary
Constructors Modifier Constructor Description DocTermsIndexDocValues(ValueSource vs, LeafReaderContext context, java.lang.String field)protectedDocTermsIndexDocValues(ValueSource vs, SortedDocValues termsIndex)
-
Method Summary
All Methods Static 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?booleanexists(int doc)Returns true if there is a value for this documentprotected intgetOrdForDoc(int doc)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 toFunctionValues.floatVal(int).FunctionValues.ValueFillergetValueFiller()intnumOrd()abstract java.lang.ObjectobjectVal(int doc)Native Java Object representation of the value(package private) static SortedDocValuesopen(LeafReaderContext context, java.lang.String field)intordVal(int doc)java.lang.StringstrVal(int doc)java.lang.StringtoString(int doc)protected abstract java.lang.StringtoTerm(java.lang.String readableValue)
-
-
-
Field Detail
-
termsIndex
protected final SortedDocValues termsIndex
-
vs
protected final ValueSource vs
-
val
protected final MutableValueStr val
-
spareChars
protected final CharsRefBuilder spareChars
-
lastDocID
private int lastDocID
-
-
Constructor Detail
-
DocTermsIndexDocValues
public DocTermsIndexDocValues(ValueSource vs, LeafReaderContext context, java.lang.String field) throws java.io.IOException
- Throws:
java.io.IOException
-
DocTermsIndexDocValues
protected DocTermsIndexDocValues(ValueSource vs, SortedDocValues termsIndex)
-
-
Method Detail
-
getOrdForDoc
protected int getOrdForDoc(int doc) throws java.io.IOException- Throws:
java.io.IOException
-
toTerm
protected abstract java.lang.String toTerm(java.lang.String readableValue)
-
exists
public boolean exists(int doc) throws java.io.IOExceptionDescription copied from class:FunctionValuesReturns true if there is a value for this document- Overrides:
existsin classFunctionValues- Throws:
java.io.IOException
-
ordVal
public int ordVal(int doc) throws java.io.IOException- Overrides:
ordValin classFunctionValues- 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()
- Overrides:
numOrdin classFunctionValues- Returns:
- the number of unique sort ordinals this instance has
-
bytesVal
public boolean bytesVal(int doc, BytesRefBuilder target) throws java.io.IOExceptionDescription copied from class:FunctionValuesreturns the bytes representation of the string val - TODO: should this return the indexed raw bytes not?- Overrides:
bytesValin classFunctionValues- Throws:
java.io.IOException
-
strVal
public java.lang.String strVal(int doc) throws java.io.IOException- Overrides:
strValin classFunctionValues- Throws:
java.io.IOException
-
boolVal
public boolean boolVal(int doc) throws java.io.IOException- Overrides:
boolValin classFunctionValues- Throws:
java.io.IOException
-
objectVal
public abstract java.lang.Object objectVal(int doc) throws java.io.IOExceptionDescription copied from class:FunctionValuesNative Java Object representation of the value- Overrides:
objectValin classFunctionValues- Throws:
java.io.IOException
-
getRangeScorer
public ValueSourceScorer getRangeScorer(Weight weight, LeafReaderContext readerContext, java.lang.String lowerVal, java.lang.String upperVal, boolean includeLower, boolean includeUpper) throws java.io.IOException
Description copied from class:FunctionValuesYields aScorerthat matches documents with values between the specified range, and that which produces scores equal toFunctionValues.floatVal(int).- Overrides:
getRangeScorerin classFunctionValues- Throws:
java.io.IOException
-
toString
public java.lang.String toString(int doc) throws java.io.IOException- Specified by:
toStringin classFunctionValues- Throws:
java.io.IOException
-
getValueFiller
public FunctionValues.ValueFiller getValueFiller()
- Overrides:
getValueFillerin classFunctionValues
-
open
static SortedDocValues open(LeafReaderContext context, java.lang.String field) throws java.io.IOException
- Throws:
java.io.IOException
-
-