# Prevent Indexing everything

**URL:** <https://discuss.elastic.co/t/prevent-indexing-everything/39492>\
**Category:** Elasticsearch\
**Created:** [January 19, 2016, 12:00am UTC](https://discuss.elastic.co/t/prevent-indexing-everything/39492 "2016-01-19T00:00:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![klahnakoski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klahnakoski/32/3679_2.png) [@klahnakoski](https://discuss.elastic.co/u/klahnakoski)\
**Post date:** [January 19, 2016, 12:00am UTC](https://discuss.elastic.co/t/prevent-indexing-everything/39492/1 "2016-01-19T00:00:59Z")

</div>

I hope someone can point out the error in my mapping. I am attempting to prevent indexing inner properties of `params` that are "too deep". The `params` property can be almost anything; the shallow properties are interesting, but the deeper ones can be ignored. The mapping I am currently using still indexes everything.

I am using version 1.7.1

Thank you

```
"mappings": {
    "_default_": {
        "dynamic_templates": [
            {
                "default_deep_param": {
                    "match_pattern": "regex",
                    "match": "params\\.\\w+\\.\\w+\\..+",
                    "mapping": {
                        "index": "no"
                    }
                }
            }
        ],
        "_all": {
            "enabled": False
        },
        "_source": {
            "compress": True,
            "enabled": True
        },
        "properties": {
            "params": {
                "type": "object",
                "dynamic": True
            }
        }
    }
}
```

---

<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:** [July 5, 2017, 11:23pm UTC](https://discuss.elastic.co/t/prevent-indexing-everything/39492/2 "2017-07-05T23:23:37Z")

</div>


