Class WeightBuilder
java.lang.Object
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder<WeightBuilder>
org.elasticsearch.index.query.functionscore.WeightBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
public class WeightBuilder extends ScoreFunctionBuilder<WeightBuilder>
A query that multiplies the weight to the score.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested 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.StringNAME -
Constructor Summary
Constructors Constructor Description WeightBuilder()Standard constructor.WeightBuilder(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description protected booleandoEquals(WeightBuilder functionBuilder)Check that two instances of the same subclass of ScoreFunctionBuilder are equal.protected intdoHashCode()Hashcode for fields defined in this subclass of ScoreFunctionBuilder.protected ScoreFunctiondoToFunction(QueryShardContext context)Build the Lucene ScoreFunction for this builder.protected voiddoWriteTo(StreamOutput out)Write the subclass's components into the stream.protected voiddoXContent(XContentBuilder builder, ToXContent.Params params)Convert this subclass's data into XContent.java.lang.StringgetName()The name of this score function.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
-
WeightBuilder
public WeightBuilder()Standard constructor. -
WeightBuilder
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
Description copied from class:ScoreFunctionBuilderWrite the subclass's components into the stream.- Specified by:
doWriteToin classScoreFunctionBuilder<WeightBuilder>- Throws:
java.io.IOException
-
getName
public java.lang.String getName()Description copied from class:ScoreFunctionBuilderThe name of this score function.- Specified by:
getNamein classScoreFunctionBuilder<WeightBuilder>
-
doXContent
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOExceptionDescription copied from class:ScoreFunctionBuilderConvert this subclass's data into XContent.- Specified by:
doXContentin classScoreFunctionBuilder<WeightBuilder>- Throws:
java.io.IOException
-
doEquals
Description copied from class:ScoreFunctionBuilderCheck 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:
doEqualsin classScoreFunctionBuilder<WeightBuilder>
-
doHashCode
protected int doHashCode()Description copied from class:ScoreFunctionBuilderHashcode 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:
doHashCodein classScoreFunctionBuilder<WeightBuilder>
-
doToFunction
Description copied from class:ScoreFunctionBuilderBuild 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:
doToFunctionin classScoreFunctionBuilder<WeightBuilder>- Throws:
java.io.IOException
-