111228
(Сергей Плесовских)
November 27, 2019, 6:55am
1
Good day
How can I import .ndjson file by a command without GUI
markov00
(Marco Vettorello)
November 27, 2019, 11:19am
2
Hi @111228
You can accomplish that using the ES Bulk API:
curl -X PUT "localhost:9200/sample_data/_bulk?pretty" -H 'Content-Type: application/x-ndjson' --data-binary @sample.json
see this post for reference:
Using Bulk API , i did indeed get it to work !
Here's the final document
{ "index": {"_id":"1"}}
{ "type":"train", "name":"T01", "state":"inactive", "time":"2019-12-20 08:48:12" }
{ "index" : { "_id" : "2" } }
{ "type":"train", "name":"T02", "state":"active", "time":"2019-12-20 08:48:12" }
As well as the command used to upload the file:
curl -X PUT "localhost:9200/sample_data/_bulk?pretty" -H 'Content-Type: application/x-ndjson' --data-binary @sample.json
To any future readers: notice the…
system
(system)
Closed
December 25, 2019, 11:19am
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.