Class IDFValueSource
- java.lang.Object
-
- org.apache.lucene.queries.function.ValueSource
-
- org.apache.lucene.queries.function.valuesource.DocFreqValueSource
-
- org.apache.lucene.queries.function.valuesource.IDFValueSource
-
public class IDFValueSource extends DocFreqValueSource
Function that returns#idf(long, long)
for every document.Note that the configured Similarity for the field must be a subclass of
TFIDFSimilarity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.queries.function.valuesource.DocFreqValueSource
DocFreqValueSource.ConstDoubleDocValues, DocFreqValueSource.ConstIntDocValues
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.queries.function.valuesource.DocFreqValueSource
field, indexedBytes, indexedField, val
-
-
Constructor Summary
Constructors Constructor Description IDFValueSource(java.lang.String field, java.lang.String val, java.lang.String indexedField, BytesRef indexedBytes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static TFIDFSimilarity
asTFIDF(Similarity sim, java.lang.String field)
FunctionValues
getValues(java.util.Map context, LeafReaderContext readerContext)
Gets the values for this reader and the context that was previously passed to createWeight().java.lang.String
name()
-
Methods inherited from class org.apache.lucene.queries.function.valuesource.DocFreqValueSource
createWeight, description, equals, hashCode
-
Methods inherited from class org.apache.lucene.queries.function.ValueSource
asDoubleValuesSource, asLongValuesSource, fromDoubleValuesSource, getSortField, newContext, toString
-
-
-
-
Constructor Detail
-
IDFValueSource
public IDFValueSource(java.lang.String field, java.lang.String val, java.lang.String indexedField, BytesRef indexedBytes)
-
-
Method Detail
-
name
public java.lang.String name()
- Overrides:
name
in classDocFreqValueSource
-
getValues
public FunctionValues getValues(java.util.Map context, LeafReaderContext readerContext) throws java.io.IOException
Description copied from class:ValueSource
Gets the values for this reader and the context that was previously passed to createWeight(). The values must be consumed in a forward docID manner, and you must call this method again to iterate through the values again.- Overrides:
getValues
in classDocFreqValueSource
- Throws:
java.io.IOException
-
asTFIDF
static TFIDFSimilarity asTFIDF(Similarity sim, java.lang.String field)
-
-