Skip to content

Instantly share code, notes, and snippets.

@toyama0919
Created January 8, 2014 10:38
Show Gist options
  • Save toyama0919/8314849 to your computer and use it in GitHub Desktop.
Save toyama0919/8314849 to your computer and use it in GitHub Desktop.
elasticsearchでjsonをimportする(高速) ref: http://qiita.com/toyama0919/items/8f637794b257f9c7bbd1
http.compression: true
curl -s -XPOST localhost:9200/_bulk --data-binary @requests.json > /dev/null
curl -s -XPOST localhost:9200/_bulk --data-binary @<(head -n 2 requests.json) > /dev/null
curl --compressed -H "Content-encoding: gzip" -XPOST localhost:9200/_bulk --data-binary @requests.json.gz > /dev/null
curl --compressed -H "Content-encoding: gzip" -XPOST localhost:9200/_bulk --data-binary @requests.json.gz > /dev/null
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
{ "field1" : "value2" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment