Hi,
I am trying to import a NDJSON file in ElasticSearch but it does absolutly nothing. Here is an sample of the file :
{ "create" : { "_index" : "benchmark", "_type" : "doc", "_id" : "1" }}
{ "timestamp" : 1516367192636718750, "name" : "SREMTWTAA", "spid" : "10350", "alert" : "0.0", "curve" : "TF9", "engValidity" : "1.0", "engValue" : "OFF", "id" : "4.0", "limits" : "-", "monState" : "OK", "rawValidity" : "1.0", "sample" : "1.0", "bitOffset" : 205.0, "bitSize" : 1.0, "pk" : 102.0, "rawValue" : 0, "reveivedTime" : 1.516367195445e+18 }
The entire file is 3357174 lines long, but the command runs in 1 second and does absolutely nothing. I use the command :
curl -s -H "Content-Type: application/x-ndjson" -XPOST 'localhost:9200/_bulk' --data-binary @file.ndjson
When I don't put the '@' it says "The bulk request must be terminated by a newline [\n]" but I don't think it is related to my problem as my file ends with an empty line and a '\n' character.
I also tried to use the examples from https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html and it works.
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_id" : "2" } }
{ "create" : { "_index" : "test", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_index" : "test"} }
{ "doc" : {"field2" : "value2"} }
I don't see the difference betweem this file and mine... Please help