Skip to content

Conversation

tteofili
Copy link
Contributor

@tteofili tteofili commented Apr 30, 2025

this is a first attempt to retain the score of single portions of an ES|QL query.
this one does it via a score function.

  FROM test METADATA _score
  | WHERE match(content, "brown")
  | WHERE match(content, "fox")
  | EVAL first_score = score(match(content, "brown"))
  | KEEP id, _score, first_score
  | SORT id

this should work with all (boolean combinations of) full text functions

fixes #120082

@tteofili tteofili changed the title named queries support for ES|QL via chicken_score function named queries support for ES|QL via a score function May 22, 2025
@tteofili tteofili changed the title named queries support for ES|QL via a score function retain the scores of portions of ES|QL query, via a score function May 22, 2025
@tteofili tteofili changed the title retain the scores of portions of ES|QL query, via a score function retain the scores of portions of an ES|QL query, via a score function May 22, 2025
Copy link
Contributor

@ioanatia ioanatia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add the files that are generated for docs, even if the function is under snapshot.
See #127322 where knn is under snapshot but we still include all the doc files.

Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

We're missing the AbstractFunctionTestCase as was mentioned - one question about usage in WHERE.

Copy link
Contributor

github-actions bot commented Jul 14, 2025

🔍 Preview links for changed docs

Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

This is behind snapshot so we can iterate on this if needed for lifting restrictions etc.

@tteofili tteofili merged commit fd037bd into elastic:main Jul 15, 2025
32 of 33 checks passed
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 17, 2025
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

retain the scores of a single full text operation with multiple full text functions/operators
5 participants