Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does elasticsearch sort the document with the same score?

I am using Elasticsearch6.8 and I get a list of document in the response. Some of the document have the same score but they appear on the same order in the response list consistently. I wonder what the algorithm ES uses to sort the document with the same score?

like image 713
Joey Yi Zhao Avatar asked Mar 05 '26 01:03

Joey Yi Zhao


1 Answers

ES uses the index order when there is a tie when sorting on score.

The index order is defined by the _doc field.

like image 133
Val Avatar answered Mar 09 '26 01:03

Val



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!