1

I'm a new learned and follow AWS example here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg-upload-data.html to build my first elasticsearch application. I'm using Postman for curl command POST to append new document and index as shown here. However it seems the syntax is incorrect highlight by Postman so see if support to correct, thank you! curl code for Post in postman

updated

enter image description here

  • Refer to this Stackoverflow https://stackoverflow.com/questions/45792309/bulk-api-malformed-action-metadata-line-3-expected-start-object-but-found ,so "_bulk" missed in the end of URL. – Michael C.H. Wang Jul 31 '18 at 14:41

1 Answers1

1

If you're posting to the _bulk URL, then the lines 1 through 6 should be on a single line without newlines. Same for lines 7 and 8. And you need to add a single newline at the end. Like this:

{ "index": {"_index": "movies", "_type": "movie", "_id": "2" }}
{ "director": "...", ...}     + add a new line at the end of this line
Val
  • 207,596
  • 13
  • 358
  • 360