ejsFieldValueFactorFunction

The field_value_factor function allows you to use a field from a document to influence the score. It’s similar to using the script_score function, however, it avoids the overhead of scripting. If used on a multi-valued field, only the first value of the field is used in calculations.

Module

 FieldValueFactorFunction

FieldValueFactorFunction ( field )

Multiply the score by the value of the field, multiplied by the factor.


Parameters
field <String> the field to apply the function to.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectfactor(factor)Sets the factor.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
Objectmodifier(modifier)Sets the modifier.
StringtoJSON()

Retrieves the internal agg object. This is typically used by internal API functions so use with caution.


Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 factor

Object factor ( factor )
Sets the factor.

Parameters
factor <Float> the factor.
Returns
returns this so that calls can be chained.

 filter

Object filter ( oFilter )
Adds a filter whose matching documents will have the score function applied.

Parameters
oFilter <Filter> Any valid Filter object.
Returns
returns this so that calls can be chained.

 modifier

Object modifier ( modifier )
Sets the modifier.

Parameters
modifier <Float> the modifier, one of none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt or reciprocal
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )

Retrieves the internal agg object. This is typically used by internal API functions so use with caution.


Returns
returns this object's internal object.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo