Maximum number of 'type' for one index of Elasticsearch

Hi All,

similar question like Elasticsearch max number of documents for one index, maximum number of 'type' for one index of Elasticsearch?

Jason

Hi,

types in Elasticsearch are a convenient way of grouping similar documents. Internally documents are stored in Lucene as simple key-value pairs, so if you store a document under a certain type in Elasticsearch, that type name is internally stored in a "_type" field. Queries hitting that type are effectively filters on the whole document collection in the index. That said, there's no real limit on the numbers of types, but its probably good advice to keep the number of types small, since each type can potentially have its own mapping. Also there are potential problems when using same field names for different types, so make sure to read https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping.html before using too many types in one index.

1 Like

Hi Chirstoph,

Its helpful, thanks

Jason

Hi Christoph,

Simply to say, same filed name and different type (string or date...) of different type for one index will make some problem, like incorrect result of queries

Jason