Skip to content

Instantly share code, notes, and snippets.

View bly2k's full-sized avatar

bly2k bly2k

View GitHub Profile
@bly2k
bly2k / gist:9843335
Created March 28, 2014 21:26
Elasticsearch value_count and cardinality
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test/doc/1 -d '{ "a": "1" }'
curl -XPUT localhost:9200/test/doc/2 -d '{ "a": "1" }'
curl -XPUT localhost:9200/test/doc/3 -d '{ "a": "1" }'
curl -XPOST "localhost:9200/test/_search?search_type=count&pretty" -d '{
"aggs": {
@bly2k
bly2k / gist:9652596
Last active August 29, 2015 13:57
Elasticsearch S3 Snapshot/Restore
Install this plugin on all nodes:
https://github.com/elasticsearch/elasticsearch-cloud-aws
Then in your elasticsearch.yml file (on all nodes), setup your AWS/S3 credentials:
cloud:
aws:
access_key: your_access_key
secret_key: your_secret_key
@bly2k
bly2k / gist:9468905
Last active August 29, 2015 13:57
Elasticsearch external mvel script example
Step 1:
Under the config/scripts folder, create a file named helloworld.mvel
Step 2:
Edit the file helloworld.mvel and put this and save:
"hello world"