Merged
Conversation
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Member
carlosdelest
left a comment
There was a problem hiding this comment.
LGTM! A couple of things to address:
- A possible ClassCastException when using a non-double value for lambda
- A test for the zero case for lambda
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/MMR.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/MMR.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/MMR.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/physical/MMRExec.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
Show resolved
Hide resolved
mamazzol
pushed a commit
to mamazzol/elasticsearch
that referenced
this pull request
Mar 30, 2026
mouhc1ne
pushed a commit
to shmuelhanoch/elasticsearch
that referenced
this pull request
Mar 31, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
still a draft, still in progress
Fixes various MMR bugs:
The way we mutate
queryVectorin the constructor, wrapping it in ato_dense_vectorfunction call, causes these tests to fail:elasticsearch/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/MMR.java
Lines 45 to 58 in 12a10a9
This is because
queryVectoris part of theNodeInfofor MMR and it seems to be an anti-pattern to mutate it in the constructor (I couldn't find otherLogicalPlans where we do this).We don't check that the query vector is actually foldable and resolved to a constant. So it's possible to do
| MMR my_vector ON my_other_vector LIMIT 10. Surprisingly, the ES|Q succeeds, because we evaluate the query vector tonullinMMRExec.(in progress) Query vectors that are keywords, can lead to 500 errors:
error:
error: