Ok, I'm at a loss. I'm starting to work with 6.0 and I read here that the preferred type name in 6.x is '_doc'. However, when I try to PUT a new document, I get an error from the (6.0.1) server:
Document mapping type name can't start with '_'
I am using the precise example from the 6.x manual for UPDATE and further if I use 'doc' instead '_doc', it works fine.
Is the joke on me?
$ curl localhost:32798
{
"name" : "IsUdPpi",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "0pvQUrwaSc-wO9f7XAA87w",
"version" : {
"number" : "6.0.1",
"build_hash" : "601be4a",
"build_date" : "2017-12-04T09:29:09.525Z",
"build_snapshot" : false,
"lucene_version" : "7.0.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
$ curl -XPUT 'localhost:32798/test/_doc/1?pretty' -H 'Content-Type: application/json' -d'
{
"counter" : 1,
"tags" : ["red"]
}
'
{
"error" : {
"root_cause" : [
{
"type" : "invalid_type_name_exception",
"reason" : "Document mapping type name can't start with '_', found: [_doc]"
}
],
"type" : "invalid_type_name_exception",
"reason" : "Document mapping type name can't start with '_', found: [_doc]"
},
"status" : 400
}
$ curl -XPUT 'localhost:32798/test/doc/2?pretty' -H 'Content-Type: application/json' -d'
{
"counter" : 1,
"tags" : ["red"]
}
'
{
"_index" : "test",
"_type" : "doc",
"_id" : "2",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}