且构网

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

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

更新时间:2021-07-11 17:19:40

必须在这样的一行上指定资源对象

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.