Skip to content

Expose _eval()-based sort_by scores in search response #2339

@andyjaar

Description

@andyjaar

When using an _eval(...) expression in the sort_by parameter, would it be possible to expose that computed score in the JSON response.

"sort_by": "_eval((tag:foo):50,(category:bar):30):desc"

Hit would be something like:

[
  document: [],
  geo_distance_meters: ['locations' : 1234],
  highlight: [],
  highlights: [],
  sort_by_evals: [50]
]

If using multiple _evals, array would give score per _eval.

Is this possible - is there any workaround for it now, other than manually reproducing the logic on our side?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions