# Index mapping created but data types are still the same

**URL:** <https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851>\
**Category:** Elasticsearch\
**Created:** [June 8, 2019, 8:39pm UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851 "2019-06-08T20:39:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prabhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhav/32/64630_2.png) [@Prabhav](https://discuss.elastic.co/u/Prabhav)\
**Post date:** [June 8, 2019, 8:39pm UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851/1 "2019-06-08T20:39:07Z")

</div>

I have created a suitable index mapping for the data and their respective data types but when i proceed to check for the mapping of the same index it ends up showing text and keyword. In my opinion i have done everything correct but the error being displayed to me is as follows in the image below:-

 ![Capture2](https://us1.discourse-cdn.com/elastic/original/3X/c/b/cb0147b0fda60147530d19b9ddcc3fc31a02d26c.png)

---

<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:** [June 9, 2019, 3:25am UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851/2 "2019-06-09T03:25:23Z")

</div>

You called the Index Doxument API not the Create Index API.

---

<div class="post-metadata">

**Author:** ![Prabhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhav/32/64630_2.png) [@Prabhav](https://discuss.elastic.co/u/Prabhav)\
**Post date:** [June 9, 2019, 10:28pm UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851/3 "2019-06-09T22:28:32Z")

</div>

Can you tell what is the difference , since in the end it's being uploaded to the same index. So what difference does it make?

---

<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:** [June 10, 2019, 2:47am UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851/4 "2019-06-10T02:47:22Z")

</div>

Create Index API is meant to create a new index which will be able then to receive documents. With this API you can define settings, mappings...

Index Document API is used to index a document in an index.

```
// Create an index
PUT myindex

// Index a document 
PUT myindex/_doc/1
{
  "foo": "bar"
}
```

---

<div class="post-metadata">

**Author:** ![thachnv92](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thachnv92](https://discuss.elastic.co/u/thachnv92)\
**Post date:** [June 10, 2019, 10:07am UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851/5 "2019-06-10T10:07:51Z")

</div>

I tested on version 7.1.0.  
I don't create mapping for data, but index pattern help do it.  
It is smart ^^  
I think you don't need to create mapping data.

---

<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 8, 2019, 10:07am UTC](https://discuss.elastic.co/t/index-mapping-created-but-data-types-are-still-the-same/184851/6 "2019-07-08T10:07:53Z")

</div>

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