# Document field type (integer) does not match mapping (keyword)

**URL:** <https://discuss.elastic.co/t/document-field-type-integer-does-not-match-mapping-keyword/234412>\
**Category:** Elasticsearch\
**Created:** [May 26, 2020, 7:54pm UTC](https://discuss.elastic.co/t/document-field-type-integer-does-not-match-mapping-keyword/234412 "2020-05-26T19:54:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldfish](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goldfish/32/21075_2.png) [@goldfish](https://discuss.elastic.co/u/goldfish)\
**Post date:** [May 26, 2020, 7:54pm UTC](https://discuss.elastic.co/t/document-field-type-integer-does-not-match-mapping-keyword/234412/1 "2020-05-26T19:54:43Z")

</div>

A document in my Elasticsearch cluster has a field whose type conflicts with the mapping for that index. In this case, the mapping type is keyword, whereas the value of the field in the document is an integer.

The field in question in the mapping:

```auto
$ curl -sS localhost:9200/indexname/_mapping | jq '.indexname.mappings.properties.foo.properties.should_be_keyword.type'
"keyword"

```

The field in question in the document (note truncated integer value):

```auto
$ curl -sS localhost:9200/indexname/_search -H 'Content-type: application/json' -d '{"query":{"term":{"_id":"1ae3f3cd-0741-4977-ae4b-358033810e28"}}}' | jq '.hits.hits[0]._source.foo.should_be_keyword'
1364401746309800000

```

Can anyone explain this behavior?

---

<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:** [June 23, 2020, 7:54pm UTC](https://discuss.elastic.co/t/document-field-type-integer-does-not-match-mapping-keyword/234412/2 "2020-06-23T19:54:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
