# Type validation in elastic serach

**URL:** <https://discuss.elastic.co/t/type-validation-in-elastic-serach/13292>\
**Category:** Elasticsearch\
**Created:** [August 22, 2013, 6:10am UTC](https://discuss.elastic.co/t/type-validation-in-elastic-serach/13292 "2013-08-22T06:10:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritesh](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@ritesh](https://discuss.elastic.co/u/ritesh)\
**Post date:** [August 22, 2013, 6:10am UTC](https://discuss.elastic.co/t/type-validation-in-elastic-serach/13292/1 "2013-08-22T06:10:00Z")

</div>

Hi,

Following mapping I have defined for one of my types.

{  
"user": {  
"properties": {  
"userid": {  
"dynamic":"false",  
"type": "string"  
},  
"password": {  
"dynamic":"false",  
"type": "string"

```
        }
    }
}

```

}

I want to make sure that documents that will be indexed must conform to the types I have defined in the ablove mapping. userid filed is string, so it should not accept numbers and this is why I have used dynamic property which is set to false. Also in the config file I have set index.mapper.dynamic to false. But this is not working for me when I index below document

{"userid":"u001","password":123}

It gets inserted. What may be the reason and how can I enforce type checking while indexing a document.

Thaks.

---

<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:20am UTC](https://discuss.elastic.co/t/type-validation-in-elastic-serach/13292/2 "2017-07-06T02:20:16Z")

</div>


