Last active
May 9, 2020 15:06
-
-
Save jprante/15f570be70504285a678 to your computer and use it in GitHub Desktop.
Put binary data to Elasticsearch
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
# 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" | |
} | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't seem to work against AWS ES 5.3 (the latest).