Class ValueSource
java.lang.Object
org.apache.lucene.queries.function.ValueSource
- Direct Known Subclasses:
BoolFunction,ConstNumberSource,DocFreqValueSource,DualFloatFunction,FieldCacheSource,LinearFloatFunction,LiteralValueSource,MaxDocValueSource,MultiFloatFunction,MultiFunction,MultiValueSource,NormValueSource,NumDocsValueSource,OrdFieldSource,QueryValueSource,RangeMapFloatFunction,ReciprocalFloatFunction,ReverseOrdFieldSource,ScaleFloatFunction,SingleFunction,SumTotalTermFreqValueSource,TaxonomyFacetSumValueSource.ScoreValueSource,TotalTermFreqValueSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateWeight(Map context, IndexSearcher searcher) Implementations should propagate createWeight to sub-ValueSources which can optionally store weight info in the context.abstract Stringdescription of field, used in explain()abstract booleangetSortField(boolean reverse) EXPERIMENTAL: This method is subject to change.abstract FunctionValuesgetValues(Map context, AtomicReaderContext readerContext) Gets the values for this reader and the context that was previously passed to createWeight()abstract inthashCode()static MapnewContext(IndexSearcher searcher) Returns a new non-threadsafe context map.toString()
-
Constructor Details
-
ValueSource
public ValueSource()
-
-
Method Details
-
getValues
public abstract FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException Gets the values for this reader and the context that was previously passed to createWeight()- Throws:
IOException
-
equals
-
hashCode
public abstract int hashCode() -
description
description of field, used in explain() -
toString
-
createWeight
Implementations should propagate createWeight to sub-ValueSources which can optionally store weight info in the context. The context object will be passed to getValues() where this info can be retrieved.- Throws:
IOException
-
newContext
Returns a new non-threadsafe context map. -
getSortField
EXPERIMENTAL: This method is subject to change.Get the SortField for this ValueSource. Uses the
getValues(java.util.Map, AtomicReaderContext)to populate the SortField.- Parameters:
reverse- true if this is a reverse sort.- Returns:
- The
SortFieldfor the ValueSource
-