Skip to content

Scoring support in ES|QL #116599

@tteofili

Description

@tteofili

This meta-issue covers the work needed to enable scoring when using running full-text queries in ES|QL.

High Level Vision: score is just a regular column, no magic

Scoring is enabled through a METADATA field, _score. For example,

FROM employees METADATA _score
  | WHERE title:"test"
  | SORT _score
  • Scoring is explicit, opt-in ( via METADATA )
  • By adding METADATA _score a score column is added to the table
  • The _score column is “dynamic”, potentially any command could alter it
  • WHERE .. MATCH will affect the score (in the same as an ES query would)
  • No implicit sorting on score. Sorting can be achieved through existing commands, e.g. a | SORT _score
### Tasks
- [x] enable scoring with METADATA _score: #113120
- [ ] https://github.com/elastic/elasticsearch/issues/120082
- [x] clarify valid _score overrides
- [x] make score collector parameters configurable/inferrable
- [x] clarify scoring behavior with subqueries
- [ ] test for scoring consistency across _search and ES|QL with METADATA _score
- [x] clarify valid scenarios for _score manipulation
- [ ] refactor EsQueryExect.Sort to allow non-FieldAttribute backed Sorts (e.g., _score)
- [ ] https://github.com/elastic/elasticsearch/issues/117641
- [ ] test how scoring works with aggregation commands
- [ ] make it possible to explain scores (EXPLAIN api)
- [ ] clarify behavior when a _score field exists in a targeted index
- [ ] https://github.com/elastic/elasticsearch/issues/118460
- [ ] https://github.com/elastic/elasticsearch/issues/120940
- [ ] https://github.com/elastic/elasticsearch/pull/121793
- [ ] https://github.com/elastic/elasticsearch/pull/124540

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions