# Limit number of mapping fields

**URL:** https://discuss.elastic.co/t/limit-number-of-mapping-fields/345226
**Category:** Elasticsearch
**Created:** [October 17, 2023, 2:34pm UTC](https://discuss.elastic.co/t/limit-number-of-mapping-fields/345226 "2023-10-17T14:34:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MathieuINTIA](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@MathieuINTIA](https://discuss.elastic.co/u/MathieuINTIA)
#### Post date: [October 17, 2023, 2:34pm UTC](https://discuss.elastic.co/t/limit-number-of-mapping-fields/345226/1 "2023-10-17T14:34:24Z")

</div>

Hello everyone,

I have a mapping with well defined fields and fields that I don't want to see either indexed or in the mapping.

Here's my mapping definition:

```auto
mappings: {
    dynamic: false,
    properties: {
      '@timestamp': { type: 'date' },
      instance: { type: 'keyword' },
      severity: { type: 'keyword' },

      path: { type: 'keyword' },
      message: { type: 'text' },
      context: { type: 'flattened', index: false, ignore_above: 8191, doc_values: false },
      error: { type: 'flattened', index: false, ignore_above: 8191, doc_values: false },

      clickContext: {
        properties: {
          xPosition: { type: 'integer', index: false },
          yPosition: { type: 'integer', index: false },
          attributes: { type: 'flattened', index: false, ignore_above: 8191, doc_values: false },
        },
      },
    }
  }

```

How can I modify my mapping so that I don't have any subfields underneath the `context`, `error` and `attributes` properties, I just want to have the raw data.

---

<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: [November 14, 2023, 2:34pm UTC](https://discuss.elastic.co/t/limit-number-of-mapping-fields/345226/2 "2023-11-14T14:34:39Z")

</div>

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