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
public abstract class ValueSource extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ValueSource()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcreateWeight(java.util.Map context, IndexSearcher searcher)Implementations should propagate createWeight to sub-ValueSources which can optionally store weight info in the context.abstract java.lang.Stringdescription()description of field, used in explain()abstract booleanequals(java.lang.Object o)SortFieldgetSortField(boolean reverse)EXPERIMENTAL: This method is subject to change.abstract FunctionValuesgetValues(java.util.Map context, AtomicReaderContext readerContext)Gets the values for this reader and the context that was previously passed to createWeight()abstract inthashCode()static java.util.MapnewContext(IndexSearcher searcher)Returns a new non-threadsafe context map.java.lang.StringtoString()
-
-
-
Method Detail
-
getValues
public abstract FunctionValues getValues(java.util.Map context, AtomicReaderContext readerContext) throws java.io.IOException
Gets the values for this reader and the context that was previously passed to createWeight()- Throws:
java.io.IOException
-
equals
public abstract boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public abstract int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
description
public abstract java.lang.String description()
description of field, used in explain()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
createWeight
public void createWeight(java.util.Map context, IndexSearcher searcher) throws java.io.IOExceptionImplementations 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:
java.io.IOException
-
newContext
public static java.util.Map newContext(IndexSearcher searcher)
Returns a new non-threadsafe context map.
-
getSortField
public SortField getSortField(boolean reverse)
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
-
-