0
votes

C:\Users\vishal\Desktop>curl -s -H "Content-Type: application/x-ndjson" -XPOST "http://localhost:9200/products/_bulk" --data-binary "@products-bulk-json";

{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400}

1

1 Answers

0
votes

Modify your bulk API request in this format

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/index-name/_bulk?pretty' --data-binary @products-bulk-json

And, make sure that your json file is in this format

{"index":{}}
{"col1" : "val1"}
{"index":{}}
{"col1" : "val1"}
{"index":{}}
{"col1" : "val1"}