bhomass
bhomass

Reputation: 3572

what is the @param in elasticsearch bulk load

I am following the tutorial in https://www.elastic.co/guide/en/kibana/current/getting-started.html

I downloaded the sample json files and put it in
/mydirectory/data/accounts.json

according to the documentation, you would type curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json

Of course then you get an error { "statusCode": 400, "error": "Bad Request", "message": "child \"uri\" fails because [\"uri\" must be a valid uri]", "validation": { "source": "query", "keys": [ "uri" ] } }

because I don't see anyway to indicate which directory I stored the json file. How do you get it to know where to find the search. I googled all around, and am amazed to not find the answer. How did everybody else figure this out?

Upvotes: 0

Views: 221

Answers (1)

Val
Val

Reputation: 217304

You need to specify the full path after the @ character, like this

curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @/mydirectory/data/accounts.json

An alternative is to first run cd /mydirectory/data and then you can use

curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json

Upvotes: 1

Related Questions