Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set elasticsearch index.mapping.total_fields.limit to unlimited

I am dealing with a huge json blob so I need to open the seal. How can I set elasticsearch index.mapping.total_fields.limit to unlimited?

like image 455
Hao Avatar asked Mar 31 '17 09:03

Hao


1 Answers

You cannot set it to unlimited. In fact, it has been intentionally limited to prevent mapping explosion. You can read the the github issue here.

The only to achieve what you want is by using a high value.

You can specify that value when creating the index:

PUT test
{
  "shopfront": {
    "index.mapping.total_fields.limit": 2000,
    "number_of_shards": 5,
    "number_of_replicas": 2
  },
  "mappings": {
    ...
  }
}

Or if it is for an existing index:

PUT shopfront/_settings
{
  "index.mapping.total_fields.limit": 2000
}
like image 186
Hyder B. Avatar answered Nov 14 '22 20:11

Hyder B.