pub enum Function {
Show 14 variants Weight(Weight), RandomScore(RandomScore), FieldValueFactor(FieldValueFactor), DecayDateTime(Decay<DateTime<Utc>>), DecayLocation(Decay<GeoLocation>), DecayI8(Decay<i8>), DecayI16(Decay<i16>), DecayI32(Decay<i32>), DecayI64(Decay<i64>), DecayU8(Decay<u8>), DecayU16(Decay<u16>), DecayU32(Decay<u32>), DecayU64(Decay<u64>), Script(Script),
}
Expand description

Functions available for use in FunctionScoreQuery

Variants§

§

Weight(Weight)

§

RandomScore(RandomScore)

§

FieldValueFactor(FieldValueFactor)

§

DecayDateTime(Decay<DateTime<Utc>>)

§

DecayLocation(Decay<GeoLocation>)

§

DecayI8(Decay<i8>)

§

DecayI16(Decay<i16>)

§

DecayI32(Decay<i32>)

§

DecayI64(Decay<i64>)

§

DecayU8(Decay<u8>)

§

DecayU16(Decay<u16>)

§

DecayU32(Decay<u32>)

§

DecayU64(Decay<u64>)

§

Script(Script)

Implementations§

Creates an instance of Weight

Creates an instance of RandomScore

Creates an instance of FieldValueFactor

  • field - Field to be extracted from the document.

Creates an instance of Decay

  • function - Decay function variant
  • field - Field to apply function to
  • origin - The point of origin used for calculating distance. Must be given as a number for numeric field, date for date fields and geo point for geo fields. Required for geo and numeric field. For date fields the default is now. Date math (for example now-1h) is supported for origin.
  • scale - Required for all types. Defines the distance from origin + offset at which the computed score will equal decay parameter. For geo fields: Can be defined as number+unit (1km, 12m,…​). Default unit is meters. For date fields: Can to be defined as a number+unit (“1h”, “10d”,…​). Default unit is milliseconds. For numeric field: Any number.

Creates an instance of script

  • source - script source

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.