I am using ElasticSearch 6.7.0, and I am currently working through its tutorial. Currently, I am stuck at this step, which requires me to download some sample data stored inside a file accounts.json. Here is a small snippet of the file:
{"index":{"_id":"988"}}
{"account_number":988,"balance":17803,"firstname":"Lucy","lastname":"Castro","age":34,"gender":"F","address":"425 Fleet Walk","employer":"Geekfarm","email":"lucycastro@geekfarm.com","city":"Mulino","state":"VA"}
{"index":{"_id":"990"}}
{"account_number":990,"balance":44456,"firstname":"Kelly","lastname":"Steele","age":35,"gender":"M","address":"809 Hoyt Street","employer":"Eschoir","email":"kellysteele@eschoir.com","city":"Stewartville","state":"ID"}
{"index":{"_id":"995"}}
{"account_number":995,"balance":21153,"firstname":"Phelps","lastname":"Parrish","age":25,"gender":"M","address":"666 Miller Place","employer":"Pearlessa","email":"phelpsparrish@pearlessa.com","city":"Brecon","state":"ME"}
The file is saved inside the path C:\Users\Me\Desktop\accounts.json.
I ran the following command, as instructed in the tutorial:
PS C:\Users\Me\Downloads\curl-7.64.1-win64-mingw\bin> .\curl.exe -H
"Content-Type: applicati lhost:9200/bank/_doc/_bulk?pretty&refresh"
--data-binary "C:\Users\Me\Desktop\accounts.json"
I received this error message:
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "The bulk request must be terminated by a newline [\n]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "The bulk request must be terminated by a newline [\n]"
  },
  "status" : 400
 }
To fix this, I went to the end of the file and inserted a new line by pressing Enter. However, the same error message appeared when I ran the command again.
How can I fix this issue?