Atlas search performance enhancements and indexing

I’m seeking your advice on performance enhancement for atlas search aggregation, currently I have this index

    {
      "mappings": {
        "dynamic": true,
        "fields": {
          "text": [
            {
              "dynamic": true,
              "type": "document"
            },
            {
              "analyzer": "lucene.arabic",
              "type": "string"
            }
          ],
        }
      }
    }

Do you have any recommendations to enhance the index ?

G’day Malak!

You can reduce the size of the search index (and likely increase performance and relevance) by using static mappings instead of dynamic. Dynamic mappings index all supported field types; static mappings index a selection of fields.

It would be helpful to include more details on the size of your data set, Atlas cluster tier, and typical performance you are seeing at the moment. If you can’t reduce the size of the search index you could consider upgrading to a cluster tier with more resources.

Regards,
Stennie

1 Like

Hi @MalakMSAH,

While going through the index definition, I got confused that why there is "fields" when dynamic is true. This is quiet contradicting. When you set dynamic to true, no need to mention “fields” as it indexes all the fields inside that collection. We use static mapping (by setting dynamic: false), to specify only specific fileds and as explained by Stennie, it reduces the size of index and it is best practice to index only those fields by analysing the query.

Happy to discuss more on this.

Thanks,
Darshan

1 Like

Hi there!

I’m a product manager from Atlas Search. I agree with the feedback listed above. I’d love to understand what queries you are running, as that may impact performance, and any other problems you are facing.

Best,
Elle

2 Likes