-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ES|QL] Add Decay function #132729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[ES|QL] Add Decay function #132729
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…f distance unit strings
… of equalTo (to work with rounded values)
ioanatia
approved these changes
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
I checked the last review from @carlosdelest and it looks like you addressed all comments.
leemthompo
approved these changes
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs look good for this first iteration 👍
carlosdelest
reviewed
Sep 8, 2025
.../esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/score/Decay.java
Outdated
Show resolved
Hide resolved
.../esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/score/Decay.java
Outdated
Show resolved
Hide resolved
.../esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/score/Decay.java
Outdated
Show resolved
Hide resolved
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 9, 2025
…SET and INLINESTATS commands) (#134358) Three PRs have just been merged that cause failures in `test-release`, and a third PR changes ES|QL railroad diagrams for another recently released change to `KNN` (also a snapshot-only feature). * #132729 - `DecayTests` has over 300 failures * #134029 - `ParsingTests` had six new failures * #124725 - Failures in `VerifierTests` and `OptimizerVerificationTests` This PR attempts to fix all in one, because if we do this in separate PRs they will fail due to the failures cause by the other PRs.
rjernst
pushed a commit
to rjernst/elasticsearch
that referenced
this pull request
Sep 9, 2025
Kubik42
pushed a commit
to Kubik42/elasticsearch
that referenced
this pull request
Sep 9, 2025
Kubik42
pushed a commit
to Kubik42/elasticsearch
that referenced
this pull request
Sep 9, 2025
…SET and INLINESTATS commands) (elastic#134358) Three PRs have just been merged that cause failures in `test-release`, and a third PR changes ES|QL railroad diagrams for another recently released change to `KNN` (also a snapshot-only feature). * elastic#132729 - `DecayTests` has over 300 failures * elastic#134029 - `ParsingTests` had six new failures * elastic#124725 - Failures in `VerifierTests` and `OptimizerVerificationTests` This PR attempts to fix all in one, because if we do this in separate PRs they will fail due to the failures cause by the other PRs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>non-issue
:Search Relevance/ES|QL
Search functionality in ES|QL
Team:Search Relevance
Meta label for the Search Relevance team in Elasticsearch
v9.2.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses ESQL: Add decay functions
This PR introduces the
decay
function for numeric, spatial and temporal data types. For better intuition on decay functions you can read up on the detailed example on the decay function in the ES docs.Key differences to the existing decay function:
decay
also works with dates using nanosecond precision (type
:date_nanos
)decay
also works on cartesian points (using euclidean distance)The function supports the following data types for the main input (
value
):int
,double
,long
,geo_point
,cartesian_point
,datetime
,date_nanos
.Numeric (
int
) example:Creating the index:
Indexing sample data:
Querying using the Query DSL:
Querying using ES|QL:
Spatial (GeoPoint) example:
Creating the index:
Indexing sample data:
Querying using the Query DSL:
Querying using ES|QL:
Temporal (Datetime) example:
Creating the index:
Indexing sample data:
Querying using the Query DSL:
Querying using ES|QL: