PS C:\cmsp1\Elasticsearch> curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_bulk?pretty&refresh" --data-binary "@accounts.json"
Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/json" value of type "System.String" to type "System.Collections.IDictionary".
At line:1 char:9
The first few lines of the account.json is:
{"index":{"_id":"1"}}
{"account_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes Lane","employer":"Pyrami","email":"amberduke@pyrami.com","city":"Brogan","state":"IL"}
{"index":{"_id":"6"}}
{"account_number":6,"balance":5686,"firstname":"Hattie","lastname":"Bond","age":36,"gender":"M","address":"671 Bristol Street","employer":"Netagy","email":"hattiebond@netagy.com","city":"Dante","state":"TN"}
{"index":{"_id":"13"}}
Can you help? I run on Win 10
Download curl for Windows and invoke the curl.exe with the parameters as above. You may consider putting curl.exe in the path environment variable, and removing the curl alias in your PowerShell profile:
Each line must end with \n and not \r\n in the new line delimited JSON bulk request body.
If you save the file directly from GitHub with right-click > save, it'll be \n delimited. The alternative is to change the existing file you have to replace \r\n with \n.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.