Do you have any index template that is being applied to the device index or the other indice name that you tried?
I was only able to replicate this if I have an index template created without specifying the type in the template and without using include_type_name=true when creating the template.
Without a template:
REQUEST
POST device/device/169062
{
"device_name": "DESK-0002",
"device_ip": "1.1.1.1",
"device_os": "Default",
"device_status": "Online"
}
RESPONSE
#! Deprecation: [types removal] Specifying types in document index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, or /{index}/_create/{id}).
{
"_index" : "device",
"_type" : "device",
"_id" : "169062",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}
WIth a template without specifying the type:
Same request as above.
RESPONSE
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "Rejecting mapping update to [device] as the final mapping would have more than 1 type: [_doc, device]"
}
],
"type" : "illegal_argument_exception",
"reason" : "Rejecting mapping update to [device] as the final mapping would have more than 1 type: [_doc, device]"
},
"status" : 400
}
But even with this error, the indice is created, just without the document.
So GET device/_search returns:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
It's strange that it shows index not found for you.
Anyway, the best solution is to not use types as this is deprecated and was removed in version 8.
If you still want to keep using types you need to check if you have any templates being applied to the device index, and if you have you need to recreate the templates with the type.