Class ScriptScoreFunctionBuilder
java.lang.Object
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder<ScriptScoreFunctionBuilder>
org.elasticsearch.index.query.functionscore.ScriptScoreFunctionBuilder
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public class ScriptScoreFunctionBuilder extends ScoreFunctionBuilder<ScriptScoreFunctionBuilder>
A function that uses a script to compute or influence the score of documents
that match with the inner query or filter.
-
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 Modifier and Type Field Description static java.lang.String
NAME
-
Constructor Summary
Constructors Constructor Description ScriptScoreFunctionBuilder(StreamInput in)
Read from a stream.ScriptScoreFunctionBuilder(Script script)
-
Method Summary
Modifier and Type Method Description protected boolean
doEquals(ScriptScoreFunctionBuilder 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(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Convert this subclass's data into XContent.static ScriptScoreFunctionBuilder
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
java.lang.String
getName()
The name of this score function.Script
getScript()
Methods inherited from class org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder
equals, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeTo
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
ScriptScoreFunctionBuilder
-
ScriptScoreFunctionBuilder
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
Description copied from class:ScoreFunctionBuilder
Write the subclass's components into the stream.- Specified by:
doWriteTo
in classScoreFunctionBuilder<ScriptScoreFunctionBuilder>
- Throws:
java.io.IOException
-
getScript
-
doXContent
public void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOExceptionDescription copied from class:ScoreFunctionBuilder
Convert this subclass's data into XContent.- Specified by:
doXContent
in classScoreFunctionBuilder<ScriptScoreFunctionBuilder>
- Throws:
java.io.IOException
-
getName
public java.lang.String getName()Description copied from class:ScoreFunctionBuilder
The name of this score function.- Specified by:
getName
in classScoreFunctionBuilder<ScriptScoreFunctionBuilder>
-
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<ScriptScoreFunctionBuilder>
-
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<ScriptScoreFunctionBuilder>
-
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<ScriptScoreFunctionBuilder>
-
fromXContent
public static ScriptScoreFunctionBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException, ParsingException- Throws:
java.io.IOException
ParsingException
-