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 .
Last active
March 4, 2024 13:23
-
-
Save renshuki/2b89ab2258a6d22200218046dd0231fe 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