Last active
June 5, 2016 15:10
-
-
Save mudge/6062586 to your computer and use it in GitHub Desktop.
Convert Elasticsearch search output into bulk format.
This file contains hidden or 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
paste -d '\n' <(curl 127.0.0.1:9200/collection/_search | jq -c '.hits.hits[] | {"index": {_index, _type, _id}}') <(curl 127.0.0.1:9200/collection/_search | jq -c '.hits.hits[]._source') |
Or like this as described here
curl -s -XGET "http://127.0.0.1:9200/test/_search" \
| jq -c '.hits.hits[] | { index: {_index:._index, _type:._type, _id:._id}}, ._source'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. This has saved me a bunch of time!