Gosforth
(Gosforth)
October 19, 2020, 2:45pm
1
What I understand _type is not required now.
So first scenario:
POST host/_bulk
{ "index":{ "_index": "myindex"} }
{ "name":"john doe","age":25 }
Does not work
Scenario 2:
POST host/myindex/_bulk
{ "index":{ } }
{ "name":"john doe","age":25 }
Does not work
Scenario 3:
POST host/myindex/_type/_bulk
{ "index":{ } }
{ "name":"john doe","age":25 }
Does not work
What is the correct query?
dadoonet
(David Pilato)
October 19, 2020, 3:16pm
2
I'd use for now:
POST /myindex/_doc/_bulk
{ "index": { } }
{ "name": "john doe", "age": 25 }
1 Like
Gosforth
(Gosforth)
October 21, 2020, 12:42pm
3
dadoonet:
oc/_bulk
Thank you. Looks like '_doc' causes error.
#! Deprecation: [types removal] Specifying types in bulk requests is deprecated.
{
"took" : 113,
"errors" : false,
"items" : [
{
"index" : {
"_index" : "test_index",
"_type" : "_doc",
"_id" : "aJEqS3UBcGLv9iq-EsyO",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
}
]
}
Without it, it's fine.
dadoonet
(David Pilato)
October 22, 2020, 12:44pm
4
Right. The right way is to send:
DELETE /myindex
POST /myindex/_bulk
{ "index": { } }
{ "name": "john doe", "age": 25 }
system
(system)
Closed
November 19, 2020, 12:44pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.