Search code examples
sortingelasticsearchazure-cognitive-search

How are results sorted when the query is empty?


I can't find any informations on Azure Search documentation about how the results are sorted when the query sent is empty. I've also read the Empty Search section of ElasticSearch but still can't find any answer.

Is this sorting by Key?

Is the backend sending a batch of parallel requests and concatenate the results since the sorting doesn't matter?


Solution

  • in case of empty query, the sort order is unspecified. You cannot rely on any particular order. If you need a specific order, ask for it using orderby query parameter. HTH, Eugene