Index mapping created but data types are still the same

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:-

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

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?

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"
}

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.

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