How to insert test data into ElasticSearch 6.x

If you just want to insert some test documents into ElasticSearch 6.x, you can use this simple command:

curl -X POST "localhost:9200/mydocuments/_doc/" -H 'Content-Type: application/json' -d"
    \"test\" : true,
    \"post_date\" : \"$(date -Ins)\"

Run this command multiple times to insert multiple documents!

In case of success, this will output a message like


Also see the official docs on the indexing API.