BULK API : Malformed action/metadata line [3], expected START_OBJECT but found [VALUE_STRING]

前端 未结 3 1853
北海茫月
北海茫月 2020-12-20 11:36

Using Elasticsearch 5.5,getting the following error while posting this bulk request, unable to figure out what is wrong with the request.

\"type\": \"illegal         


        
3条回答
  •  旧巷少年郎
    2020-12-20 12:27

    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" }
    

    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.

提交回复
热议问题