Last active
December 8, 2021 16:43
-
-
Save romiras/dc96cdebf3ae5d3f1ab5f6f55e5c10fd to your computer and use it in GitHub Desktop.
Script for uploading 30 K dataset into ES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
split --verbose -l1000 dataset-bulk-30k.ndjson bulk. | |
for f in bulk.??; do echo $f; curl -i -X POST localhost:9200/_bulk -H "Content-Type: application/x-ndjson" --data-binary @$f; done |
For uploading to ElasticSearch that requires authentication you can add a parameter -u "$ES_MASTER_USER:$ES_MASTER_PW"
to curl command above.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Split 30K ndjson dataset into chunks 1000 per file, then import into ES with cURL.