# Any way to add custom constraints on mapping dynamically generated?

**URL:** <https://discuss.elastic.co/t/any-way-to-add-custom-constraints-on-mapping-dynamically-generated/19504>\
**Category:** Elasticsearch\
**Created:** [August 28, 2014, 7:29am UTC](https://discuss.elastic.co/t/any-way-to-add-custom-constraints-on-mapping-dynamically-generated/19504 "2014-08-28T07:29:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_Zhou\_2](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@Jeffrey\_Zhou\_2](https://discuss.elastic.co/u/Jeffrey_Zhou_2)\
**Post date:** [August 28, 2014, 7:29am UTC](https://discuss.elastic.co/t/any-way-to-add-custom-constraints-on-mapping-dynamically-generated/19504/1 "2014-08-28T07:29:11Z")

</div>

Our Elasticsearch cluster by default enables the dynamic mapping, which  
allows to dynamically generate the mappings for the incoming documents.  
However, we found that sometimes the not-well defined incoming documents  
could pollute the mappings. For example, some mappings could contain  
thousands of properties. As we don't want to lose the flexibility of  
dynamic mapping, and also like to prevent the mappings from being polluted  
by not-well defined documents. So we'd like to know if it's possible to add  
some mappings constraints, such as maximum number of properties allowed  
under a type, via existing Elasticsearch configuration settings or customer  
plugin.

Regards,  
Jeffrey

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1e95d537-a1f4-4abd-95ca-5cb1d40011bb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1e95d537-a1f4-4abd-95ca-5cb1d40011bb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:05am UTC](https://discuss.elastic.co/t/any-way-to-add-custom-constraints-on-mapping-dynamically-generated/19504/2 "2017-07-06T01:05:52Z")

</div>

Closed on July 6, 2017, 1:05am UTC


