Class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>>
java.lang.Object
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder<FB>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
- Direct Known Subclasses:
DecayFunctionBuilder
,FieldValueFactorFunctionBuilder
,RandomScoreFunctionBuilder
,ScriptScoreFunctionBuilder
,WeightBuilder
public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>>
extends Object
implements org.elasticsearch.common.xcontent.ToXContentFragment, NamedWriteable
-
Nested Class Summary
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
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionStandard empty constructor.Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
Check that two instances of the same subclass of ScoreFunctionBuilder are equal.protected abstract int
Hashcode for fields defined in this subclass of ScoreFunctionBuilder.protected abstract ScoreFunction
doToFunction(SearchExecutionContext context)
Build the Lucene ScoreFunction for this builder.protected abstract void
doWriteTo(StreamOutput out)
Write the subclass's components into the stream.protected abstract void
doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Convert this subclass's data into XContent.boolean
abstract String
getName()
The name of this score function.The weight applied to the function before combining.Returns the name of the writeable objectint
hashCode()
setWeight(float weight)
Set the weight applied to the function before combining.toFunction(SearchExecutionContext context)
Called on a data node, converts this ScoreFunctionBuilder into its corresponding Lucene function object.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.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
-
Constructor Details
-
ScoreFunctionBuilder
public ScoreFunctionBuilder()Standard empty constructor. -
ScoreFunctionBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
doWriteTo
Write the subclass's components into the stream.- Throws:
IOException
-
getName
The name of this score function. -
setWeight
Set the weight applied to the function before combining. -
getWeight
The weight applied to the function before combining. -
toXContent
public final org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
doXContent
protected abstract void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOExceptionConvert this subclass's data into XContent.- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
-
equals
-
doEquals
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. -
hashCode
public final int hashCode() -
doHashCode
protected abstract int doHashCode()Hashcode for fields defined in this subclass of ScoreFunctionBuilder. Implementers should ignore fields defined in ScoreFunctionBuilder because they will already be in the hashCode. -
toFunction
Called on a data node, converts this ScoreFunctionBuilder into its corresponding Lucene function object.- Throws:
IOException
-
doToFunction
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.- Throws:
IOException
-