命令以下:shell
curl -s -XPOST http://localhost:9200/_bulk --data-binary @data.json
若是上傳的data.json文件較大,能夠將其切分爲多個小文件,在批量上傳,shell腳本以下:json
#!/bin/bash split -l 100000 -a 10 data.json ./tmp/carrier_bulk BULK_FILES=./tmp/carrier_bulk* for f in $BULK_FILES; do curl -s -XPOST http://localhost:9200/_bulk --data-binary @$f >> /dev/null echo $f >> ./import.log done