# Org.elasticsearch.index.mapper.MapperParsingException

**URL:** https://discuss.elastic.co/t/org-elasticsearch-index-mapper-mapperparsingexception/7976
**Category:** Elasticsearch
**Created:** [June 5, 2012, 7:17am UTC](https://discuss.elastic.co/t/org-elasticsearch-index-mapper-mapperparsingexception/7976 "2012-06-05T07:17:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cjacobson](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@cjacobson](https://discuss.elastic.co/u/cjacobson)
#### Post date: [June 5, 2012, 7:17am UTC](https://discuss.elastic.co/t/org-elasticsearch-index-mapper-mapperparsingexception/7976/1 "2012-06-05T07:17:22Z")

</div>

Can I guarantee the appropriate data type is being indexed by defining  
"properties" when defining my \_mapping? So, in the below example, even if  
the first document to be indexed incorrectly defines "username" as an  
OBJECT, that will be the document which fails, instead of all subsequent  
documents which define "username" correctly as a STRING.

EX:

curl -XPUT '[http://127.0.0.1/user\_idx/directory\_search/\_mapping](http://127.0.0.1/user_idx/directory_search/_mapping)' -d '{  
"directory\_search" : {  
"properties" : {  
"state.username" : {"type":"string","store":"yes",  
"index\_analyzer":"standard"},  
"state.firstname" : {"type":"string","store":"yes",  
"index\_analyzer":"standard"},  
"state.lastname" : {"type":"string","store":"yes",  
"index\_analyzer":"standard"}  
}  
}  
}'

---

<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, 3:25am UTC](https://discuss.elastic.co/t/org-elasticsearch-index-mapper-mapperparsingexception/7976/2 "2017-07-06T03:25:39Z")

</div>


