Trying to understand atlas search autocomplete result

I have this query

      {
        $search: {
          index: 'autocomplete',
          autocomplete: {
            query: args.searchText,
            path: 'title',
            tokenOrder: 'sequential',
            fuzzy: {
              maxEdits: 2,
            },
          },
        },
      },

This index

{
  "mappings": {
    "dynamic": false,
    "fields": {
      "title": [
        {
          "foldDiacritics": false,
          "maxGrams": 7,
          "minGrams": 3,
          "tokenization": "edgeGram",
          "type": "autocomplete"
        }
      ]
    }
  }
}

Getting this result… I would think salesforce would be first? Any idea what setting I can tinker with?

1 Like

I thought maybe I just needed to sort my aggregation by a score field, but my understanding is atlas search/the $search step is doing that by default?

So not sure if its my $search options or the index settings that are not giving me what I’m aiming for

1 Like

Here’s another where it is giving me the intended result, but it seems to be the last result for some reason

1 Like