Is it able to get rank (order number) of _score in Elasticsearch script score?

I would like to use _score in script score, calculating its rank in entire hits.

For example, if there are these 3 hit documents;

{ "_id": 1, "_score": 0.7 }
{ "_id": 2, "_score": 0.5 }
{ "_id": 3, "_score": 1.0 }

I would like to rank of score as 2, 3, 1 for each documents and use the rank in script score.
It it able to do such thing?

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