Skip to content

Instantly share code, notes, and snippets.

@jprante
Last active May 9, 2020 15:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jprante/15f570be70504285a678 to your computer and use it in GitHub Desktop.
Save jprante/15f570be70504285a678 to your computer and use it in GitHub Desktop.
Put binary data to Elasticsearch
# first, set
#
# http.compression: true
#
# in config/elasticsearch.yml
curl -XDELETE 'localhost:9200/test'
rm -f content.json content.json.gz
echo '{"content":"Hello World"}' > content.json
gzip content.json
curl -H 'accept-encoding: gzip,deflate' -H 'content-encoding: gzip' -XPUT 'localhost:9200/test/docs/1' --compress --data-binary @content.json.gz
curl -XGET 'localhost:9200/test/_refresh'
curl -XGET 'localhost:9200/test/docs/_search?pretty' -d '
{
"query" : {
"match" : {
"content" : "Hello World"
}
}
}
'
@aaaronic
Copy link

This doesn't seem to work against AWS ES 5.3 (the latest).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment