Sorting with Atlas search


Today Atlas Search supports sorting only number and date fields using the ‘near’ operator.
Sorting string fields is not supported.

The alternative of using storedSource and sort stage after search stage is working too slow when handling a lot of documents.

My questions are:

  • When a complete sort solution will be supported inside the $search stage?
  • In the meanwhile, is defining collection indexes to support the sort can help? e.g. what happens with documents results of the mongot process after it completes the search stage? does the mongod process uses collection indexes or it ignore them and doing the sort of the documents in-mem\disk?

Thanks a lot,

1 Like

Hello! I’m facing the same issue. An answer would help.
Thanks a lot!