I am a newbie of elasticsearch. I create a mapping using such code:
PUT /my-demo1
{
"mappings": {
"properties": {
"dsu_sn": {
"type": "keyword"
},
"iot_id": {
"type": "keyword"
},
"test_suite_id": {
"type": "text"
},
"error_code": {
"type": "long"
}
}
}
}
ES responses mapper [iot_id] cannot be changed from type [keyword] to [text]
when I index a document using such code:
POST /my-demo1/1
{
"dsu_sn": "ssl123321",
"iot_id": "550068573720395776",
"test_suite_id": "com.example.test.wifi",
"error_code": 2
}
You need to add _doc
in URL while posting a document to Elasticsearch, change the URL to POST /my-demo1/_doc/1
Refer removal of types for more info.