FunctionScoreFunction

zio.elasticsearch.query.FunctionScoreFunction
See theFunctionScoreFunction companion trait

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def expDecayFunction[S](field: Field[S, _], origin: String, scale: String): DecayFunction[S]

Constructs a type-safe instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Exp using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Constructs a type-safe instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Exp using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Value parameters

field

the type-safe field for which query is specified for

origin

the point of origin used for calculating distance

scale

defines the distance from origin + offset at which the computed score will equal decay parameter

Attributes

Returns

an instance of zio.elasticsearch.query.DecayFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def expDecayFunction(field: String, origin: String, scale: String): DecayFunction[Any]

Constructs an instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Exp using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Constructs an instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Exp using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Value parameters

field

the field for which query is specified for

origin

the point of origin used for calculating distance

scale

defines the distance from origin + offset at which the computed score will equal decay

Attributes

Returns

an instance of zio.elasticsearch.query.DecayFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def fieldValueFactor[S](field: Field[S, _]): FieldValueFactor[S]

Constructs a type-safe instance of zio.elasticsearch.query.FieldValueFactor using the specified parameters. zio.elasticsearch.query.FieldValueFactor function allows you to use a field from a document to influence the score. It is similar to using the zio.elasticsearch.query.ScriptScoreFunction, 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.

Constructs a type-safe instance of zio.elasticsearch.query.FieldValueFactor using the specified parameters. zio.elasticsearch.query.FieldValueFactor function allows you to use a field from a document to influence the score. It is similar to using the zio.elasticsearch.query.ScriptScoreFunction, 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.

Value parameters

field

the type-safe field to be extracted from the document

Attributes

Returns

an instance of zio.elasticsearch.query.FieldValueFactor that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

Constructs an instance of zio.elasticsearch.query.FieldValueFactor using the specified parameters. zio.elasticsearch.query.FieldValueFactor function allows you to use a field from a document to influence the score. It is similar to using the zio.elasticsearch.query.ScriptScoreFunction, 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.

Constructs an instance of zio.elasticsearch.query.FieldValueFactor using the specified parameters. zio.elasticsearch.query.FieldValueFactor function allows you to use a field from a document to influence the score. It is similar to using the zio.elasticsearch.query.ScriptScoreFunction, 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.

Value parameters

field

the field to be extracted from the document

Attributes

Returns

an instance of zio.elasticsearch.query.FieldValueFactor that represents the zio.elasticsearch.query.FunctionScoreQuery to be performed.

def gaussDecayFunction[S](field: Field[S, _], origin: String, scale: String): DecayFunction[S]

Constructs a type-safe instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Gauss using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Constructs a type-safe instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Gauss using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Value parameters

field

the type-safe field for which query is specified for

origin

the point of origin used for calculating distance

scale

defines the distance from origin + offset at which the computed score will equal decay parameter

Attributes

Returns

an instance of zio.elasticsearch.query.DecayFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def gaussDecayFunction(field: String, origin: String, scale: String): DecayFunction[Any]

Constructs an instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Gauss using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Constructs an instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Gauss using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Value parameters

field

the field for which query is specified for

origin

the point of origin used for calculating distance

scale

defines the distance from origin + offset at which the computed score will equal decay

Attributes

Returns

an instance of zio.elasticsearch.query.DecayFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def linearDecayFunction[S](field: Field[S, _], origin: String, scale: String): DecayFunction[S]

Constructs a type-safe instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Linear using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Constructs a type-safe instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Linear using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Value parameters

field

the type-safe field for which query is specified for

origin

the point of origin used for calculating distance

scale

defines the distance from origin + offset at which the computed score will equal decay parameter

Attributes

Returns

an instance of zio.elasticsearch.query.DecayFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def linearDecayFunction(field: String, origin: String, scale: String): DecayFunction[Any]

Constructs an instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Exp using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Constructs an instance of zio.elasticsearch.query.DecayFunction with decayFunctionType of zio.elasticsearch.query.DecayFunctionType.Exp using the specified parameters. zio.elasticsearch.query.DecayFunction is used to score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to zio.elasticsearch.query.RangeQuery, but with smooth edges instead of boxes.

Value parameters

field

the field for which query is specified for

origin

the point of origin used for calculating distance

scale

defines the distance from origin + offset at which the computed score will equal decay

Attributes

Returns

an instance of zio.elasticsearch.query.DecayFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def randomScoreFunction(): RandomScoreFunction[Any]

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Attributes

Returns

an instance of zio.elasticsearch.query.RandomScoreFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def randomScoreFunction(seed: Long): RandomScoreFunction[Any]

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Value parameters

seed

the final score will be computed based on this value and default value for field which is "_seq_no"

Attributes

Returns

an instance of zio.elasticsearch.query.RandomScoreFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def randomScoreFunction[S](seed: Long, field: Field[S, _]): RandomScoreFunction[S]

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Value parameters

field

the type-safe field for which zio.elasticsearch.query.RandomScoreFunction is specified for

seed

the final score will be computed based on this value and value for field

Attributes

Returns

an instance of zio.elasticsearch.query.RandomScoreFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def randomScoreFunction(seed: Long, field: String): RandomScoreFunction[Any]

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Constructs an instance of zio.elasticsearch.query.RandomScoreFunction using the specified parameters. zio.elasticsearch.query.RandomScoreFunction generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc IDs as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

Value parameters

field

the field value that will be used to compute final score

seed

the final score will be computed based on this value and value for field

Attributes

Returns

an instance of zio.elasticsearch.query.RandomScoreFunction that can be used in zio.elasticsearch.query.FunctionScoreQuery to be performed.

def scriptScoreFunction(script: Script): ScriptScoreFunction[Any]

Constructs an instance of zio.elasticsearch.query.ScriptScoreFunction using the specified parameters. zio.elasticsearch.query.ScriptScoreFunction function allows you to wrap another zio.elasticsearch.query.ElasticQuery and customize the scoring of it optionally with a computation derived from other numeric field values in the doc using a script expression.

Constructs an instance of zio.elasticsearch.query.ScriptScoreFunction using the specified parameters. zio.elasticsearch.query.ScriptScoreFunction function allows you to wrap another zio.elasticsearch.query.ElasticQuery and customize the scoring of it optionally with a computation derived from other numeric field values in the doc using a script expression.

Value parameters

script

the zio.elasticsearch.script.Script that will be used to calculate score

Attributes

Returns

an instance of zio.elasticsearch.query.ScriptScoreFunction that represents the zio.elasticsearch.query.FunctionScoreQuery to be performed.

def scriptScoreFunction(scriptSource: String): ScriptScoreFunction[Any]

Constructs an instance of zio.elasticsearch.query.ScriptScoreFunction using the specified parameters. zio.elasticsearch.query.ScriptScoreFunction function allows you to wrap another zio.elasticsearch.query.ElasticQuery and customize the scoring of it optionally with a computation derived from other numeric field values in the doc using a script expression.

Constructs an instance of zio.elasticsearch.query.ScriptScoreFunction using the specified parameters. zio.elasticsearch.query.ScriptScoreFunction function allows you to wrap another zio.elasticsearch.query.ElasticQuery and customize the scoring of it optionally with a computation derived from other numeric field values in the doc using a script expression.

Value parameters

scriptSource

the script source to use and create zio.elasticsearch.script.Script that will be used to calculate score

Attributes

Returns

an instance of zio.elasticsearch.query.ScriptScoreFunction that represents the zio.elasticsearch.query.FunctionScoreQuery to be performed.

def weightFunction(weight: Double): WeightFunction[Any]

Constructs an instance of zio.elasticsearch.query.WeightFunction using the specified parameters. zio.elasticsearch.query.WeightFunction score allows you to multiply the score by the provided weight.

Constructs an instance of zio.elasticsearch.query.WeightFunction using the specified parameters. zio.elasticsearch.query.WeightFunction score allows you to multiply the score by the provided weight.

Value parameters

weight

the non-negative number you wish to multiply the score with

Attributes

Returns

an instance of zio.elasticsearch.query.WeightFunction that can be used to in zio.elasticsearch.query.FunctionScoreQuery.