# Can I make Elasticsearch strictly parse string fields (reject numbers)?

**URL:** <https://discuss.elastic.co/t/can-i-make-elasticsearch-strictly-parse-string-fields-reject-numbers/32035>\
**Category:** Elasticsearch\
**Created:** [October 12, 2015, 8:27pm UTC](https://discuss.elastic.co/t/can-i-make-elasticsearch-strictly-parse-string-fields-reject-numbers/32035 "2015-10-12T20:27:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dave](https://discuss.elastic.co/u/dave)\
**Post date:** [October 12, 2015, 8:27pm UTC](https://discuss.elastic.co/t/can-i-make-elasticsearch-strictly-parse-string-fields-reject-numbers/32035/1 "2015-10-12T20:27:00Z")

</div>

If I have a field whose mapping is of type string, and I index a document where that field is a number, Elasticsearch just stringifies that number and stores it. I don't want this behavior. I want Elasticsearch to reject documents with numbers in fields of type string. Is this possible?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 14, 2015, 1:47am UTC](https://discuss.elastic.co/t/can-i-make-elasticsearch-strictly-parse-string-fields-reject-numbers/32035/2 "2015-10-14T01:47:24Z")

</div>

No because a string is alphanumeric.  
If you want to do that you have to do it at index time in your code.

---

<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:44pm UTC](https://discuss.elastic.co/t/can-i-make-elasticsearch-strictly-parse-string-fields-reject-numbers/32035/3 "2017-07-05T23:44:57Z")

</div>


