Class FieldValueFactorFunctionBuilder
java.lang.Object
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder<FieldValueFactorFunctionBuilder>
org.elasticsearch.index.query.functionscore.FieldValueFactorFunctionBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
public class FieldValueFactorFunctionBuilder
extends ScoreFunctionBuilder<FieldValueFactorFunctionBuilder>
Builder to construct
field_value_factor functions for a function
score query.-
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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoEquals(FieldValueFactorFunctionBuilder functionBuilder)Check that two instances of the same subclass of ScoreFunctionBuilder are equal.protected intHashcode for fields defined in this subclass of ScoreFunctionBuilder.protected ScoreFunctiondoToFunction(SearchExecutionContext context)Build the Lucene ScoreFunction for this builder.protected voiddoWriteTo(StreamOutput out)Write the subclass's components into the stream.voiddoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)Convert this subclass's data into XContent.floatfactor()factor(float boostFactor)fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)getName()The name of this score function.missing()missing(double missing)Value used instead of the field value for documents that don't have that field defined.modifier()modifier(FieldValueFactorFunction.Modifier modifier)Methods inherited from class org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder
equals, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
DEFAULT_MODIFIER
-
DEFAULT_FACTOR
public static final float DEFAULT_FACTOR- See Also:
- Constant Field Values
-
-
Constructor Details
-
FieldValueFactorFunctionBuilder
-
FieldValueFactorFunctionBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
Description copied from class:ScoreFunctionBuilderWrite the subclass's components into the stream.- Specified by:
doWriteToin classScoreFunctionBuilder<FieldValueFactorFunctionBuilder>- Throws:
IOException
-
getName
Description copied from class:ScoreFunctionBuilderThe name of this score function.- Specified by:
getNamein classScoreFunctionBuilder<FieldValueFactorFunctionBuilder>
-
fieldName
-
factor
-
factor
public float factor() -
missing
Value used instead of the field value for documents that don't have that field defined. -
missing
-
modifier
-
modifier
-
doXContent
public void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOExceptionDescription copied from class:ScoreFunctionBuilderConvert this subclass's data into XContent.- Specified by:
doXContentin classScoreFunctionBuilder<FieldValueFactorFunctionBuilder>- Throws:
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<FieldValueFactorFunctionBuilder>
-
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<FieldValueFactorFunctionBuilder>
-
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<FieldValueFactorFunctionBuilder>
-
fromXContent
public static FieldValueFactorFunctionBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException, ParsingException- Throws:
IOExceptionParsingException
-