Elasticsearch match_all default sort?

How elaticsearch sort in case of match_all query when the _score is 1 of all the documents available in an index?

Not sure about the details but you should never rely on it IMO.
What is your problem if any?

Thanks for such a quick reply .
I have been doing a semester project on ElasticSearch.
I am just doing some educational research on elasticsearch.
I just want to know about the default sorting mechanism of match_all query.
and why it returns only 10 document when we use match_all query.
kindly reply fast.

It always returns by default 10 documents whatever the query is.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html

My question is which 10 it returns by default ?
there must be some kind of mechanism of choosing those 10 (particularly the case of match_all in which the score of all the available docs is 1).

I'd say the 1st 10 of each shard then the first 10 of that aggregated list.

But it does not matter IMO.

Thanks Mr. David

After your last reply, is it safe to say that elasticsearch doesnt apply any sort in match_all query?

I think you can say that.

1 Like

Thanks for your help Mr. David

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