public abstract class DecayFunctionBuilder<DFB extends DecayFunctionBuilder> extends ScoreFunctionBuilder<DFB>
Modifier and Type | Class and Description |
---|---|
static class |
DecayFunctionBuilder.AbstractDistanceScoreFunction
This is the base class for scoring a single field.
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<R>
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DECAY |
static double |
DEFAULT_DECAY |
static MultiValueMode |
DEFAULT_MULTI_VALUE_MODE |
protected static java.lang.String |
OFFSET |
protected static java.lang.String |
ORIGIN |
protected static java.lang.String |
SCALE |
weight
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
DecayFunctionBuilder(java.lang.String fieldName,
BytesReference functionBytes) |
protected |
DecayFunctionBuilder(java.lang.String fieldName,
java.lang.Object origin,
java.lang.Object scale,
java.lang.Object offset) |
protected |
DecayFunctionBuilder(java.lang.String fieldName,
java.lang.Object origin,
java.lang.Object scale,
java.lang.Object offset,
double decay) |
Modifier and Type | Method and Description |
---|---|
protected abstract DFB |
createFunctionBuilder(java.lang.String fieldName,
BytesReference functionBytes) |
protected boolean |
doEquals(DFB functionBuilder) |
protected int |
doHashCode() |
protected DFB |
doReadFrom(StreamInput in) |
protected ScoreFunction |
doToFunction(QueryShardContext context) |
protected void |
doWriteTo(StreamOutput out) |
void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
protected abstract DecayFunction |
getDecayFunction()
Override this function if you want to produce your own scorer.
|
java.lang.String |
getFieldName() |
BytesReference |
getFunctionBytes() |
MultiValueMode |
getMultiValueMode() |
ScoreFunctionBuilder |
setMultiValueMode(MultiValueMode multiValueMode) |
buildWeight, equals, getName, getWeight, getWriteableName, hashCode, readFrom, setWeight, toFunction, toXContent, writeTo
protected static final java.lang.String ORIGIN
protected static final java.lang.String SCALE
protected static final java.lang.String DECAY
protected static final java.lang.String OFFSET
public static double DEFAULT_DECAY
public static MultiValueMode DEFAULT_MULTI_VALUE_MODE
protected DecayFunctionBuilder(java.lang.String fieldName, java.lang.Object origin, java.lang.Object scale, java.lang.Object offset)
protected DecayFunctionBuilder(java.lang.String fieldName, java.lang.Object origin, java.lang.Object scale, java.lang.Object offset, double decay)
protected DecayFunctionBuilder(java.lang.String fieldName, BytesReference functionBytes)
public java.lang.String getFieldName()
public BytesReference getFunctionBytes()
public void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder>
java.io.IOException
public ScoreFunctionBuilder setMultiValueMode(MultiValueMode multiValueMode)
public MultiValueMode getMultiValueMode()
protected DFB doReadFrom(StreamInput in) throws java.io.IOException
doReadFrom
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder>
java.io.IOException
protected abstract DFB createFunctionBuilder(java.lang.String fieldName, BytesReference functionBytes)
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder>
java.io.IOException
protected boolean doEquals(DFB functionBuilder)
doEquals
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder>
protected int doHashCode()
doHashCode
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder>
protected ScoreFunction doToFunction(QueryShardContext context) throws java.io.IOException
doToFunction
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder>
java.io.IOException
protected abstract DecayFunction getDecayFunction()