# Required fields

**URL:** <https://discuss.elastic.co/t/required-fields/13078>\
**Category:** Elasticsearch\
**Created:** [August 5, 2013, 9:33pm UTC](https://discuss.elastic.co/t/required-fields/13078 "2013-08-05T21:33:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristi](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kristi](https://discuss.elastic.co/u/Kristi)\
**Post date:** [August 5, 2013, 9:33pm UTC](https://discuss.elastic.co/t/required-fields/13078/1 "2013-08-05T21:33:53Z")

</div>

Is it possible to define required fields in the mapping for a document type? So if you try to index a document and it's missing the required fields, you would get an error message?

---

<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, 2:22am UTC](https://discuss.elastic.co/t/required-fields/13078/2 "2017-07-06T02:22:47Z")

</div>


