Elasticsearch: Bulk request throws error in Elasticsearch 6.1.1

前端 未结 16 2046
日久生厌
日久生厌 2020-12-16 11:35

I recently upgraded to Elasticsearch version 6.1.1 and now I can\'t bulk index documents from a JSON file. When I do it inline, it works fine. Here are the contents of the d

相关标签:
16条回答
  • 2020-12-16 12:23

    As the document says: use the --data-binary flag instead of plain -d

    -d doesn’t preserve newlines and doesn't format the json.

    I faced this problem because of JSON formatting.

    0 讨论(0)
  • 2020-12-16 12:24

    The error is pretty clear:

    The bulk request must be terminated by a newline [\n]
    

    So you simply need to add a newline at the end of your customers_full.json file and you'll be ok.

    0 讨论(0)
  • 2020-12-16 12:27

    For anyone using postman to make requests to ElasticSearch

    Just press enter to create an empty new line!

    And voila, problem solved

    0 讨论(0)
  • 2020-12-16 12:29

    I just forget the add and @ symbol before file name like this

    --data-binary "@products.json"
    
    0 讨论(0)
提交回复
热议问题