且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

BULK API:格式错误的操作/元数据行 [3],预期为 START_OBJECT,但发现 [VALUE_STRING]

更新时间:2022-06-11 17:23:08

你的资源对象必须像这样在一行中指定

Your resource objects have to be specified on a single line like this

post /test322/type/_bulk
{ "index": {} }
{ "name": "Test1", "data": "This is my test data" }
{ "index": {} }
{ "name": "Test2", "data": "This is my test data2" }

我知道这看起来非常愚蠢和不直观,因为当您使用 PUT 或 POST 为非批量操作创建资源时,资源不必位于一行.

Which seems really stupid and unintuitive I know since resources don't have to be on a single line when you create them using PUT or POST for non-bulk operations.