$sort very slow after $search

[
{

              "$search": {

                "index": "default",

                "text": {

                  "path": "country",

                  "query": "USA",

                  "synonyms": "synonyms_country"

                }

              }

            },

            {

                "$sort":{'country' : 1}

            },
            {
             "$limit" : 100
            }

]

The sort is very slow, I only have 150k records to go through but it takes upwards of 30 seconds to get a response back. Is there a different way I need to stage my pipeline? I have an index on the country field but that does not seem to increase performance. I am running an m50. This is a stripped down version of a $search, most of them will be using compounds must and mustNots.

1 Like

Hi there! We have an early version of a solution to address this. Feel free to vote on this feedback item to updated on availability.