Skip to content

retain the scores of a single full text operation with multiple full text functions/operators #120082

@tteofili

Description

@tteofili

when using ES|QL in scenarios where relevance ranking is important (e.g., full text search, vector search, hybrid search, etc.) scores are currently computed within the _score column, as a "side effect" of the different full text capabilities (match, qstr, kql functions, : operator).
the final values contained in the _score column are the result of (summing the scores of) possibly multiple full text functions/operators, so users might need to isolate some such "parts" of one ES|QL query to better debug/understand how the final scores come together.
e.g., this could be done with a score() function, together with an EVAL:

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

In addition to that, isolating the scores of single full text operations in ES|QL might be nice in order to build custom scoring formulas.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions