# Limit of total fields \[1000\] exceeded

**URL:** <https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747>\
**Category:** Elasticsearch\
**Created:** [November 9, 2020, 11:53am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747 "2020-11-09T11:53:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 9, 2020, 11:53am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/1 "2020-11-09T11:53:01Z")

</div>

I am getting Limit of total fields [1000] in index [products] has been exceeded. Although total number of properties that is added dynamically is 499. Every where I search is asking me to increase total\_fields length since my limit haven't increased I am not planning to that. Following is the mapping of index

```auto
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "bvid": {
        "type": "keyword"
      },
      "gtin": {
        "type": "keyword"
      },
      "manufacturerCode": {
        "type": "keyword"
      },
      "productState": {
        "properties": {
          "imageReady": {
            "type": "keyword",
            "index": false
          },
          "contentReady": {
            "type": "keyword",
            "index": false
          },
          "reviewReady": {
            "type": "keyword",
            "index": false
          }
        }
      },
      "physicalStatus": {
        "properties": {
          "status": {
            "type": "keyword",
            "index": false
          }
        }
      },

      "images": {
        "properties": {
          "url": {
            "type": "keyword",
            "index": false
          },
          "thumbnailUrl": {
            "type": "keyword",
            "index": false
          },
          "imageType": {
            "type": "keyword",
            "index": false
          },
          "isHero": {
            "type": "boolean",
            "index": false
          }
        }
      }
    }
  }
}

```

Rest are dynamically added.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 9, 2020, 12:32pm UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/2 "2020-11-09T12:32:22Z")

</div>

It means that the data which is sent to your index contains too many new fields.  
Could you share one document which is failing?

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 4:16am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/3 "2020-11-10T04:16:29Z")

</div>

This is the document which is failing

```auto
{
      "name": "Good Goodies",
      "bvid": "c7befa56",
      "gtin": "8964002148134",
      "manufacturerCode": "209975",
      "images": [
        {
          "url": "https://storage.googleapis.com/",
          "thumbnailUrl": "https://storage.googleapis.com/\",
          "isHero": true,
          "imageType": "hero"
        }
      ],
      "productState": {
        "contentReady": "Complete",
        "imageReady": "Complete",
        "reviewReady": "None"
      },
      "physicalStatus": {
        "status": "Cleared"
      },
      "In Package Depth": "145",
      "Sodium Per Nutrient Basis Quantity": "135.0mg",
      "Packaging Type": "Box",
      "Level of Fat Claim": "UNIDENTIFIED",
      "Nutrient Basis Quantity": "100g",
      "Protein Per Nutrient Basis Quantity": "5.0g",
      "Type of Cake": "UNIDENTIFIED",
      "Packaging Shape": "Rectangular",
      "Sugars Per Nutrient Basis Quantity": "31.9g",
      "Packaging Recycling Process Type": "Recyclable",
      "GPC Category Code": "10000172",
      "Fibre Per Nutrient Basis Quantity": "0.4g",
      "Consumer Usage Instructions": "Store in room temperature.",
      "Net Weight": "252",
      "Ingredient Statement": "Wheat Flour,Sugar, Vegetable Oil,Invert Syrup, Fresh Eggs, Skimmed Milk Powder, Cocoa Powder, Salt, Baking Powder, Emulsifier, Potassium Sorbate, Citric Acid, Glycerin, Sorbitol, Vanillin Powder, Corn Starch, Food Preservatives, Xanthan Gum, Nature Identical Flavor and Permitted Food Color.",
      "Fat Per Nutrient Basis Quantity": "17.9g",
      "In Package Height": "70",
      "Nutrient Basis Quantity Type Code": "By Serving",
      "Product Range": "Cake",
      "Saturated Fat Per Nutrient Basis Quantity": "0.4g",
      "Special Occasion Claim": "NO",
      "Product Description": "Enjoy the three in one baked freshness of sweet fillings, great taste & nutrition.",
      "Gluten Free Claim": "NO",
      "Functional Name": "Good Goodies Merry Berry",
      "Product Form Description": "Box",
      "Packaging Feature": "Wrap",
      "Family": "Bread/Bakery Products",
      "Gross Weight": "300",
      "Energy from Fat Per Nutrient Basis Quantity": "399Cal",
      "Price Value": "108",
      "In Package Width": "180",
      "GTIN": "8964002148134",
      "Nutrient Measurement Precision": "Approximately",
      "Product Name": "Good Goodies Triple Strawberry Jam Filled Merry Berry 6 Long Cakes",
      "If Organic": "NO",
      "Cholesterol Per Nutrient Basis Quantity": "60.0mg",
      "Brand Name": "Good Goodies",
      "Carbohydrates Per Nutrient Basis Quantity": "54.5g",
      "Variant Description": "Merry Berry",
      "Class": "Sweet Bakery Products",
      "If Coated": "YES",
      "Packaging Function": "Protected",
      "Ingredient of Concern": "Contains Wheat, Eggs & Milk.",
      "GPC Category Description": "Cakes - Sweet (Shelf Stable)",
      "Brick": "Cakes - Sweet (Shelf Stable)",
      "Segment": "Food/Beverage/Tobacco",
      "If Part Baked": "YES",
      "Regulated Product Name": "Good Goodies Triple Strawberry Jam Filled Merry Berry",
      "Form of Cake": "UNCLASSIFIED",
      "Packaging Material Type": "Paper Paperboard",
      "Sub Brand": "NotApplicable",
      "Brand": "Good Goodies",
      "Brand Owner": "NoOwner"
    }

```

As you can see there are not 1000 fields

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 8:42am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/4 "2020-11-10T08:42:29Z")

</div>

What is the current mapping?

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 9:36am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/5 "2020-11-10T09:36:26Z")

</div>

This is my current mapping [https://ctxt.io/2/AAAghxsPFA](https://ctxt.io/2/AAAghxsPFA) I can't paste it here as limit exceeded. They are total 499

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 10:37am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/6 "2020-11-10T10:37:10Z")

</div>

I can reproduce the error.

If I look a the mapping file, you have around 4990 lines of mapping content.  
Knowing that a field is approximately 5 lines, I'm pretty sure you are super close to 1000 fields.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 10:38am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/7 "2020-11-10T10:38:55Z")

</div>

Oh I see what you did not understand...

When you have this for the mapping:

```auto
      "Additional Product Description": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }

```

It's actually 2 fields in elasticsearch: `Additional Product Description` and `Additional Product Description.keyword`.

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 10:46am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/8 "2020-11-10T10:46:26Z")

</div>

This explains a lot. Thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 11:06am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/9 "2020-11-10T11:06:30Z")

</div>

I'd suggest that you use a more flexible mapping.

Using may be a data structure like:

```auto
DELETE test
PUT test
{
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "bvid": {
        "type": "keyword"
      },
      "gtin": {
        "type": "keyword"
      },
      "manufacturerCode": {
        "type": "keyword"
      },
      "productState": {
        "properties": {
          "imageReady": {
            "type": "keyword",
            "index": false
          },
          "contentReady": {
            "type": "keyword",
            "index": false
          },
          "reviewReady": {
            "type": "keyword",
            "index": false
          }
        }
      },
      "physicalStatus": {
        "properties": {
          "status": {
            "type": "keyword",
            "index": false
          }
        }
      },
      "images": {
        "properties": {
          "url": {
            "type": "keyword",
            "index": false
          },
          "thumbnailUrl": {
            "type": "keyword",
            "index": false
          },
          "imageType": {
            "type": "keyword",
            "index": false
          },
          "isHero": {
            "type": "boolean",
            "index": false
          }
        }
      },
      "data": {
        "type": "nested",
        "properties": {
          "name": {
            "type": "keyword"
          },
          "value": {
            "type": "text"
          }
        }
      }
    }
  }
}
POST test/_doc
{
  "name": "Good Goodies",
  "bvid": "c7befa56",
  "gtin": "8964002148134",
  "manufacturerCode": "209975",
  "images": [
    {
      "url": "https://storage.googleapis.com/",
      "thumbnailUrl": "https://storage.googleapis.com/",
      "isHero": true,
      "imageType": "hero"
    }
  ],
  "productState": {
    "contentReady": "Complete",
    "imageReady": "Complete",
    "reviewReady": "None"
  },
  "physicalStatus": {
    "status": "Cleared"
  },
  "data": [
  { "name": "In Package Depth", "value": "145" },
  { "name": "Sodium Per Nutrient Basis Quantity", "value": "135.0mg" },
  { "name": "Packaging Type", "value": "Box" },
  { "name": "Level of Fat Claim", "value": "UNIDENTIFIED" },
  { "name": "Nutrient Basis Quantity", "value": "100g" },
  { "name": "Protein Per Nutrient Basis Quantity", "value": "5.0g" },
  { "name": "Type of Cake", "value": "UNIDENTIFIED" },
  { "name": "Packaging Shape", "value": "Rectangular" },
  { "name": "Sugars Per Nutrient Basis Quantity", "value": "31.9g" },
  { "name": "Packaging Recycling Process Type", "value": "Recyclable" },
  { "name": "GPC Category Code", "value": "10000172" },
  { "name": "Fibre Per Nutrient Basis Quantity", "value": "0.4g" },
  { "name": "Consumer Usage Instructions", "value": "Store in room temperature." },
  { "name": "Net Weight", "value": "252" },
  { "name": "Ingredient Statement", "value": "Wheat Flour,Sugar, Vegetable Oil,Invert Syrup, Fresh Eggs, Skimmed Milk Powder, Cocoa Powder, Salt, Baking Powder, Emulsifier, Potassium Sorbate, Citric Acid, Glycerin, Sorbitol, Vanillin Powder, Corn Starch, Food Preservatives, Xanthan Gum, Nature Identical Flavor and Permitted Food Color." },
  { "name": "Fat Per Nutrient Basis Quantity", "value": "17.9g" },
  { "name": "In Package Height", "value": "70" },
  { "name": "Nutrient Basis Quantity Type Code", "value": "By Serving" },
  { "name": "Product Range", "value": "Cake" },
  { "name": "Saturated Fat Per Nutrient Basis Quantity", "value": "0.4g" },
  { "name": "Special Occasion Claim", "value": "NO" },
  { "name": "Product Description", "value": "Enjoy the three in one baked freshness of sweet fillings, great taste & nutrition." },
  { "name": "Gluten Free Claim", "value": "NO" },
  { "name": "Functional Name", "value": "Good Goodies Merry Berry" },
  { "name": "Product Form Description", "value": "Box" },
  { "name": "Packaging Feature", "value": "Wrap" },
  { "name": "Family", "value": "Bread/Bakery Products" },
  { "name": "Gross Weight", "value": "300" },
  { "name": "Energy from Fat Per Nutrient Basis Quantity", "value": "399Cal" },
  { "name": "Price Value", "value": "108" },
  { "name": "In Package Width", "value": "180" },
  { "name": "GTIN", "value": "8964002148134" },
  { "name": "Nutrient Measurement Precision", "value": "Approximately" },
  { "name": "Product Name", "value": "Good Goodies Triple Strawberry Jam Filled Merry Berry 6 Long Cakes" },
  { "name": "If Organic", "value": "NO" },
  { "name": "Cholesterol Per Nutrient Basis Quantity", "value": "60.0mg" },
  { "name": "Brand Name", "value": "Good Goodies" },
  { "name": "Carbohydrates Per Nutrient Basis Quantity", "value": "54.5g" },
  { "name": "Variant Description", "value": "Merry Berry" },
  { "name": "Class", "value": "Sweet Bakery Products" },
  { "name": "If Coated", "value": "YES" },
  { "name": "Packaging Function", "value": "Protected" },
  { "name": "Ingredient of Concern", "value": "Contains Wheat, Eggs & Milk." },
  { "name": "GPC Category Description", "value": "Cakes - Sweet (Shelf Stable)" },
  { "name": "Brick", "value": "Cakes - Sweet (Shelf Stable)" },
  { "name": "Segment", "value": "Food/Beverage/Tobacco" },
  { "name": "If Part Baked", "value": "YES" },
  { "name": "Regulated Product Name", "value": "Good Goodies Triple Strawberry Jam Filled Merry Berry" },
  { "name": "Form of Cake", "value": "UNCLASSIFIED" },
  { "name": "Packaging Material Type", "value": "Paper Paperboard" },
  { "name": "Sub Brand", "value": "NotApplicable" },
  { "name": "Brand", "value": "Good Goodies" },
  { "name": "Brand Owner", "value": "NoOwner" }
  ]
}

```

This is much more flexible and is keeping the mapping as minimal as possible.  
It comes with more complex queries though as you need to deal with nested objects. See

> **[Nested field type | Elasticsearch Reference \[7.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html)**

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 11:23am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/10 "2020-11-10T11:23:48Z")

</div>

I was doing that previously but I wasn't able to do some searches where I want to make multiple name and value filter ,I ended up doing this:

```auto
{
  "mappings": {
    "dynamic_templates": [
      {
        "strings": {
          "match_mapping_type": "string",
          "mapping": {
            "type": "text"
          }
        }
      }
    ],
    "properties": {
      "name": {
        "type": "text"
      },
      "bvid": {
        "type": "keyword"
      },
      "gtin": {
        "type": "text"
      },
      "manufacturerCode": {
        "type": "text"
      },
      "productState": {
        "properties": {
          "imageReady": {
            "type": "keyword",
            "index": false
          },
          "contentReady": {
            "type": "keyword",
            "index": false
          },
          "reviewReady": {
            "type": "keyword",
            "index": false
          }
        }
      },
      "physicalStatus": {
        "properties": {
          "status": {
            "type": "keyword",
            "index": false
          }
        }
      },

      "images": {
        "properties": {
          "url": {
            "type": "keyword",
            "index": false
          },
          "thumbnailUrl": {
            "type": "keyword",
            "index": false
          },
          "imageType": {
            "type": "keyword",
            "index": false
          },
          "isHero": {
            "type": "boolean",
            "index": false
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 11:31am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/11 "2020-11-10T11:31:12Z")

</div>

> [@ahmedbrandver](#):
>
> but I wasn't able to do some searches where I want to make multiple name and value filter

Then explain what your problem was and we might help you solving the query part.

But IMO don't use a bad design because you don't know how to query...

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 11:40am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/12 "2020-11-10T11:40:48Z")

</div>

My query was I wanted to search on like on both of these value

```auto
[{ "name": "In Package Depth", "value": "145" },
  { "name": "Sodium Per Nutrient Basis Quantity", "value": "135.0mg" }]

```

I wrote a query in which I can search on both conditions but I wasn't able too. I was able to search when I apply one condition only. My query is like this

```auto
{
    "query": {
        "bool": {
            "must": [
                {
                    "nested": {
                        "path": "attributes",
                        "query": {
                            "bool": {
                                "must": [
                                    {
                                        "match": {
                                            "attributes.name": "In Package Depth"
                                        }
                                    },
                                    {
                                        "match": {
                                            "attributes.value": "135"
                                        }
                                    },
                                    {
                                        "match": {
                                            "attributes.name": "Sodium Per Nutrient Basis Quantity"
                                        }
                                    },
                                    {
                                        "match": {
                                            "attributes.value": "145"
                                        }
                                    }
                                ]
                            }
                        }
                    }
                }
            ]
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 12:58pm UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/13 "2020-11-10T12:58:21Z")

</div>

You need to write multiple nested queries in that case. Like this:

```auto
DELETE test
PUT test
{
  "mappings": {
    "properties": {
      "attributes": {
        "type": "nested",
        "properties": {
          "name": {
            "type": "keyword"
          },
          "value": {
            "type": "text"
          }
        }
      }
    }
  }
}
POST test/_doc
{
  "attributes": [
  { "name": "In Package Depth", "value": "145" },
  { "name": "Sodium Per Nutrient Basis Quantity", "value": "135.0mg" }
  ]
}

GET test/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "nested": {
            "path": "attributes",
            "query": {
              "bool": {
                "must": [
                  {
                    "match": {
                      "attributes.name": "In Package Depth"
                    }
                  },
                  {
                    "match": {
                      "attributes.value": "145"
                    }
                  }
                ]
              }
            }
          }
        },        
        {
          "nested": {
            "path": "attributes",
            "query": {
              "bool": {
                "must": [
                  {
                    "match": {
                      "attributes.name": "Sodium Per Nutrient Basis Quantity"
                    }
                  },
                  {
                    "match": {
                      "attributes.value": "135.0mg"
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}

```

Please also note that `135` does not match `135.0mg`, because of the default analyzer:

```auto
POST test/_analyze
{
  "analyzer": "default",
  "text": ["135.0mg"]
}
POST test/_analyze
{
  "analyzer": "default",
  "text": ["135"]
}

```

Gives:

```auto
# POST test/_analyze
{
  "tokens" : [
    {
      "token" : "135.0mg",
      "start_offset" : 0,
      "end_offset" : 7,
      "type" : "<ALPHANUM>",
      "position" : 0
    }
  ]
}

# POST test/_analyze
{
  "tokens" : [
    {
      "token" : "135",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "<NUM>",
      "position" : 0
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 1:03pm UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/14 "2020-11-10T13:03:40Z")

</div>

Do I need to change the analyzer too I didn't get this part. Thanks a lot I will try it like too. I am using this mapping in my other storage for ES where I am storing limited data but here I need to add whole data for searching. Thank you again for helping me with the query

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 1:09pm UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/15 "2020-11-10T13:09:28Z")

</div>

> [@ahmedbrandver](#):
>
> Do I need to change the analyzer too I didn't get this part.

Yes if you need that `135` actually matches things like `135`, `135.0`, `135.0g`, `135.0mg`.  
IMHO it's better to solve this at index time by sending data like:

```auto
POST test/_doc
{
  "attributes_text": [
    { "name": "Packaging Type", "value": "Box" }
  ],
  "attributes_int": [
    { "name": "In Package Depth", "value": 145 }
  ],
  "attributes_float": [
    { "name": "Sodium Per Nutrient Basis Quantity in mg", "value": 135.0 }
  ]
}

```

That way you can also think of using range queries on numerical fields.

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 10, 2020, 1:12pm UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/16 "2020-11-10T13:12:37Z")

</div>

And there will be separate properties for ` "attributes_text"` , ` "attributes_int"` and ` "attributes_float"`?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 10, 2020, 4:52pm UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/17 "2020-11-10T16:52:10Z")

</div>

You can do multiple things.

One is:

```auto
DELETE test 
PUT test
{
  "mappings": {
    "properties": {
      "attributes_text": {
        "type": "nested",
        "properties": {
          "name": {
            "type": "keyword"
          },
          "value": {
            "type": "text"
          }
        }
      },
      "attributes_int": {
        "type": "nested",
        "properties": {
          "name": {
            "type": "keyword"
          },
          "value": {
            "type": "integer"
          }
        }
      }
    }
  }
}

```

Another idea which will require less fields:

```auto
DELETE test 
PUT test
{
  "mappings": {
    "properties": {
      "attributes": {
        "type": "nested",
        "properties": {
          "name": {
            "type": "keyword"
          },
          "value_text": {
            "type": "text"
          },
          "value_int": {
            "type": "integer"
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![ahmedbrandver](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ahmedbrandver](https://discuss.elastic.co/u/ahmedbrandver)\
**Post date:** [November 11, 2020, 4:26am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/18 "2020-11-11T04:26:36Z")

</div>

Thanks a lot for your help 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 9, 2020, 4:26am UTC](https://discuss.elastic.co/t/limit-of-total-fields-1000-exceeded/254747/19 "2020-12-09T04:26:38Z")

</div>

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