What is a good number of fields to have in an index?

I am trying to manage the index and I would like to know how many fields must be present inside an index for it to have good performance. Currently, I have 6000 fields in my index but not all documents have 6000 fields it depends on the document (all docs has around (150-45 fields).

Is this gonna impact performance of querying and dashboards?

The recommendation is <1000. Performance will depend on your queries and mappings.

1 Like

Hi @warkolm ,
U mean to say all docs must have around 1000 fields or total fields for an index patter is 1000?

An index can have many documents (similar in nature) and every document can have a certain number of fields.

An index can be divided into multiple shards . There is a limitation of 2.14 Billion docs per shard at lucene level but you should not go beyond 1 Billion documents at any point ( in fact best practice is to have a shard of 20-30 GB in size).

If you use mapping then the default limit of index.mapping.total_fields.limit is 1000 in ES .

Note: this limitation can be changed if needed (not recommended) and is for a document. That means one document should not have more than 1000 fields in your index.

You can refer this post to get an idea.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.