Post filter results by score and max_score

Hello,
I want to show only max scored results. Is it possible? If possible could you tell me how to do it?
Thanks as lot!

Welcome!

You want to only show the document with the best score? Is that it?

In that case, just set size: 1
.
Or all documents above a given score?

You can use may be this: Search API | Elasticsearch Guide [7.16] | Elastic

But this will require to run a first query with size: 0 (for optimisation) and extract from the response the max_score and run the same query again with min_score: MAX_SCORE_VALUE.

HTH

Hi,
I need all documents where _score is equal to max_score.
Is it possible to do somehow with a single query?

Also, size:0 produces max_score: null. While size: 1 gives max_score.

Ha right!

I don't think so. But unsure.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.