ESQL: Add decay function #121526
Labels
ES|QL-ui
Impacts ES|QL UI
>feature
priority:normal
A label for assessing bug priority to be used by ES engineers
:Search Relevance/Search
Catch all for Search Relevance
Team:Search Relevance
Meta label for the Search Relevance team in Elasticsearch
We already support the following decay functions in painless for the script_score query:
Decay functions are used to penalize scores based on recency (for date types) or distance (numeric and geo types) and this is a useful feature we want to add to ES|QL.
We do not want to add 9 different decay functions. We could have a single
decay
function with the following signature:For parameters:
Type: can be
"linear"
,"exp"
or"gauss"
.Origin: numeric, spatial, date types
Scale: numeric, spatial, date types
Offset: numeric, spatial, date types
Decay: numeric
Value: numeric, spatial, date types
The return type should be double.
In terms of priority - it would make sense to add support for linear and exponential first, with gauss decay being used less in practice.
As a note we could potentially have 3 different decay functions
decay_linear
,decay_exp
anddecay_gauss
.The text was updated successfully, but these errors were encountered: