public abstract class DecayFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>> 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<V>, Writeable.Writer<V>
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 |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
DecayFunctionBuilder(StreamInput in)
Read from a stream.
|
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)
Convenience constructor that converts its parameters into json to parse on the data nodes.
|
protected |
DecayFunctionBuilder(java.lang.String fieldName,
java.lang.Object origin,
java.lang.Object scale,
java.lang.Object offset,
double decay)
Convenience constructor that converts its parameters into json to parse on the data nodes.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doEquals(DFB functionBuilder)
Check that two instances of the same subclass of ScoreFunctionBuilder are equal.
|
protected int |
doHashCode()
Hashcode for fields defined in this subclass of ScoreFunctionBuilder.
|
protected ScoreFunction |
doToFunction(QueryShardContext context)
Build the Lucene ScoreFunction for this builder.
|
protected void |
doWriteTo(StreamOutput out)
Write the subclass's components into the stream.
|
void |
doXContent(XContentBuilder builder,
ToXContent.Params params)
Convert this subclass's data into XContent.
|
protected abstract DecayFunction |
getDecayFunction()
Override this function if you want to produce your own scorer.
|
java.lang.String |
getFieldName() |
BytesReference |
getFunctionBytes() |
MultiValueMode |
getMultiValueMode() |
DFB |
setMultiValueMode(MultiValueMode multiValueMode) |
equals, getName, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeTo
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFragment
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)
protected DecayFunctionBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
ScoreFunctionBuilder
doWriteTo
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
java.io.IOException
public java.lang.String getFieldName()
public BytesReference getFunctionBytes()
public void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ScoreFunctionBuilder
doXContent
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
java.io.IOException
public DFB setMultiValueMode(MultiValueMode multiValueMode)
public MultiValueMode getMultiValueMode()
protected boolean doEquals(DFB functionBuilder)
ScoreFunctionBuilder
doEquals
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
protected int doHashCode()
ScoreFunctionBuilder
doHashCode
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
protected ScoreFunction doToFunction(QueryShardContext context) throws java.io.IOException
ScoreFunctionBuilder
doToFunction
in class ScoreFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>>
java.io.IOException
protected abstract DecayFunction getDecayFunction()