cat file.json | jq -c '.hits.hits[] | { index: {_index:._index, _type:._type, _id:._id}}, ._source' | curl -XPOST -H "Content-Type: application/x-ndjson" localhost:9200/_bulk --data-binary @- | jq .
Forked from renshuki/elasticsearch-bulk-index-from-json-hits.md
Created
March 4, 2024 13:23
-
-
Save goors/e6932928370157989c0fdbdf3258959e to your computer and use it in GitHub Desktop.
Elasticsearch - Bulk index from a JSON file hits (with jq)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment