# Limit number of fields without actually having to delete anything or hampering visualisations

**URL:** https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927
**Category:** Elasticsearch
**Created:** [November 15, 2018, 6:48pm UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927 "2018-11-15T18:48:06Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 15, 2018, 6:48pm UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/1 "2018-11-15T18:48:07Z")

</div>

Hi,

Number of fields in my index is shooting above the limit (1000). I don't want to increase the limit any further (to avoid mapping explosion) . But rather planning on to cut down on the number of fields. There are fields something like (Not exactly same):

last\_name.jacob  
last\_name.susan  
last\_name.petrice  
last\_name.george

It seems like nested fields may be an option, but does visualisations work if i do something like this?

last\_name: { jacob:  
susan:  
patrice:  
george:  
}

If not, what's the way to reduce the number of fields without essentially deleting any fields and should still be able to query and visualise everything?

Your help is very much appreciated! Thanks.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 9:29am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/2 "2018-11-19T09:29:42Z")

</div>

Can somebody please help with this?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 19, 2018, 9:37am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/3 "2018-11-19T09:37:49Z")

</div>

Why would you choose to structure your data that way? Why not just use `"last_name": "Smith","first_name":"Susan"` or something similar? Having fields created dynamically like that will generally always cause mapping explosion and be inefficient.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 9:49am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/4 "2018-11-19T09:49:37Z")

</div>

Thanks for your response 🙂

There's a requirement for me to create fields dynamically.

> Having fields created dynamically like that will generally always cause mapping explosion and be inefficient.

To avoid the this, I'm planning to use nested field or something similar.

> Why not just use `"last_name": "Smith","first_name":"Susan"` or something similar?

I need multiple entries of this kind in a single document. If you mean I could make a list like this,

"first\_name": {"susan", "jacob", "petrice", "george"}  
"last\_name": {"smith", "rrrr", "tttt", "mmmm"}

will i be able to map the last names with the corresponding first names? If i can, does visualisation work on this kind of fields ?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 19, 2018, 9:54am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/5 "2018-11-19T09:54:25Z")

</div>

You can created a nested mapping with the following structure:

```auto
"users": [
  {
    "first_name": "Susan", "last_name": "Smith"
  },
  {
    "first_name": "Adam", "last_name": "Jones"
  }
]

```

This will allow you to search on combinations of first and last name, although Kibana largely lacks support for handling nested documents. On the other hand having very large mappings is not handled well in Kibana either....

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 9:59am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/6 "2018-11-19T09:59:27Z")

</div>

so I'll have choose between "mapping explosion" and "kibana support".

Given that i presently have 1300 fields in my index, which is safer to go for? Increasing field limit or using nested fields?

will this problem be solved in any kibana upgrade( current version: 5.6.2)?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 19, 2018, 10:08am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/7 "2018-11-19T10:08:11Z")

</div>

No, I do not think upgrading will solve this issue for you. One option might be to denormalise and still one user per document, but as I do not know your use-case I can't tell whether that is an option or not. You can follow the discussion about support for nested documents in [this GitHub issue](https://github.com/elastic/kibana/issues/1084) (although there may also be others)

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 10:19am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/8 "2018-11-19T10:19:11Z")

</div>

Thanks for your help 🙂

Going through that discussion it seems like it's not completely implemented yet. Till then i should resolve to increasing the field limit i guess.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 19, 2018, 10:22am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/9 "2018-11-19T10:22:09Z")

</div>

As mappings are loaded and processed in the browser, having very large mappings can slow things down considerably, so if possible I would recommend rethinking the data model.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 10:31am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/10 "2018-11-19T10:31:25Z")

</div>

Thanks for the advice. Will try and cut down on some unnecessary fields.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 10:34am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/11 "2018-11-19T10:34:51Z")

</div>

I have a followup question, till i rethink my data-model and discuss it with my team, I want to increase the field limit dynamically.

Is there a way to dynamically change the fields limit? like, if number of fields increases to 1400, the limit should adapt to that without giving any error.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 19, 2018, 10:39am UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/12 "2018-11-19T10:39:16Z")

</div>

No, you need to set it to a specific value.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [November 19, 2018, 12:31pm UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/13 "2018-11-19T12:31:57Z")

</div>

Okay, Thanks

---

<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 17, 2018, 12:31pm UTC](https://discuss.elastic.co/t/limit-number-of-fields-without-actually-having-to-delete-anything-or-hampering-visualisations/156927/14 "2018-12-17T12:31:58Z")

</div>

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