# Find out how a document has been indexed?

**URL:** https://discuss.elastic.co/t/find-out-how-a-document-has-been-indexed/5895
**Category:** Elasticsearch
**Created:** [November 16, 2011, 10:56pm UTC](https://discuss.elastic.co/t/find-out-how-a-document-has-been-indexed/5895 "2011-11-16T22:56:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nick\_Hoffman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_hoffman/32/1872_2.png) [@Nick\_Hoffman](https://discuss.elastic.co/u/Nick_Hoffman)
#### Post date: [November 16, 2011, 10:56pm UTC](https://discuss.elastic.co/t/find-out-how-a-document-has-been-indexed/5895/1 "2011-11-16T22:56:33Z")

</div>

Hi guys. After several hours of hacking around, I discovered that the  
problem I was working on was the result of a string ("1980-01-01") being  
parsed and indexed as a date instead of a string.

Is there a way to find out how ES decided to index a document? It'd be very  
helpful to be able to see how each field was indexed, where dynamic  
templates were applied, etc.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [November 17, 2011, 1:23am UTC](https://discuss.elastic.co/t/find-out-how-a-document-has-been-indexed/5895/2 "2011-11-17T01:23:37Z")

</div>

You can ask ES for the current mapping on a given type.  
[http://localhost:9200/index/type/\_mapping](http://localhost:9200/index/type/_mapping)

You can define your own mapping by putting it before indexing your first document.  
PUT [http://localhost:9200/index/type/\_mapping](http://localhost:9200/index/type/_mapping)

See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html)

David 😉  
@dadoonet

Le 16 nov. 2011 à 23:56, Nick Hoffman [nick@deadorange.com](mailto:nick@deadorange.com) a écrit :

> Hi guys. After several hours of hacking around, I discovered that the problem I was working on was the result of a string ("1980-01-01") being parsed and indexed as a date instead of a string.
> 
> Is there a way to find out how ES decided to index a document? It'd be very helpful to be able to see how each field was indexed, where dynamic templates were applied, etc.

---

<div class="post-metadata">

### Author: ![Nick\_Hoffman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_hoffman/32/1872_2.png) [@Nick\_Hoffman](https://discuss.elastic.co/u/Nick_Hoffman)
#### Post date: [November 17, 2011, 4:44am UTC](https://discuss.elastic.co/t/find-out-how-a-document-has-been-indexed/5895/3 "2011-11-17T04:44:16Z")

</div>

Hey David. Thanks for reminding me about that. I knew you could GET the  
mapping, but didn't realize that doing so also shows the mapping for fields  
created by dynamic templates.

Cheers!

---

<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:48am UTC](https://discuss.elastic.co/t/find-out-how-a-document-has-been-indexed/5895/4 "2017-07-06T03:48:20Z")

</div>


