Class DecayFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
java.lang.Object
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder<DFB>
org.elasticsearch.index.query.functionscore.DecayFunctionBuilder<DFB>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
- Direct Known Subclasses:
ExponentialDecayFunctionBuilder
,GaussDecayFunctionBuilder
,LinearDecayFunctionBuilder
public abstract class DecayFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
extends ScoreFunctionBuilder<DFB>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This is the base class for scoring a single field.Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static String
static double
static MultiValueMode
protected static String
protected static String
protected static String
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionprotected
DecayFunctionBuilder(String fieldName, Object origin, Object scale, Object offset)
Convenience constructor that converts its parameters into json to parse on the data nodes.protected
DecayFunctionBuilder(String fieldName, Object origin, Object scale, Object offset, double decay)
Convenience constructor that converts its parameters into json to parse on the data nodes.protected
DecayFunctionBuilder(String fieldName, BytesReference functionBytes)
protected
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Check that two instances of the same subclass of ScoreFunctionBuilder are equal.protected int
Hashcode for fields defined in this subclass of ScoreFunctionBuilder.protected ScoreFunction
doToFunction(SearchExecutionContext context)
Build the Lucene ScoreFunction for this builder.protected void
doWriteTo(StreamOutput out)
Write the subclass's components into the stream.void
doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Convert this subclass's data into XContent.protected abstract DecayFunction
Override this function if you want to produce your own scorer.setMultiValueMode(MultiValueMode multiValueMode)
Methods inherited from class org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder
equals, getName, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
ORIGIN
- See Also:
- Constant Field Values
-
SCALE
- See Also:
- Constant Field Values
-
DECAY
- See Also:
- Constant Field Values
-
OFFSET
- See Also:
- Constant Field Values
-
DEFAULT_DECAY
public static final double DEFAULT_DECAY- See Also:
- Constant Field Values
-
DEFAULT_MULTI_VALUE_MODE
-
-
Constructor Details
-
DecayFunctionBuilder
Convenience constructor that converts its parameters into json to parse on the data nodes. -
DecayFunctionBuilder
protected DecayFunctionBuilder(String fieldName, Object origin, Object scale, Object offset, double decay)Convenience constructor that converts its parameters into json to parse on the data nodes. -
DecayFunctionBuilder
-
DecayFunctionBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
Description copied from class:ScoreFunctionBuilder
Write the subclass's components into the stream.- Specified by:
doWriteTo
in classScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
- Throws:
IOException
-
getFieldName
-
getFunctionBytes
-
doXContent
public void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOExceptionDescription copied from class:ScoreFunctionBuilder
Convert this subclass's data into XContent.- Specified by:
doXContent
in classScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
- Throws:
IOException
-
setMultiValueMode
-
getMultiValueMode
-
doEquals
Description copied from class:ScoreFunctionBuilder
Check that two instances of the same subclass of ScoreFunctionBuilder are equal. Implementers don't need to check any fields in ScoreFunctionBuilder, just fields that they define.- Specified by:
doEquals
in classScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
-
doHashCode
protected int doHashCode()Description copied from class:ScoreFunctionBuilder
Hashcode for fields defined in this subclass of ScoreFunctionBuilder. Implementers should ignore fields defined in ScoreFunctionBuilder because they will already be in the hashCode.- Specified by:
doHashCode
in classScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
-
doToFunction
Description copied from class:ScoreFunctionBuilder
Build the Lucene ScoreFunction for this builder. Implementers should ignore things defined in ScoreFunctionBuilder like weight as they will be handled by the function that calls this one.- Specified by:
doToFunction
in classScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
- Throws:
IOException
-
getDecayFunction
Override this function if you want to produce your own scorer.
-