Created
February 12, 2012 23:34
-
-
Save nz/1811845 to your computer and use it in GitHub Desktop.
Getting started with Bonsai.io's hosted ElasticSearch service
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
$ heroku addons:add elasticsearch:test | |
-----> Adding elasticsearch:test to bonsai-search... done, v51 (free) | |
$ heroku config | grep ELASTICSEARCH_URL | |
ELASTICSEARCH_URL => http://index.bonsai.io/pw4mw3d5y1rql88i44eo | |
$ curl 'http://index.bonsai.io/pw4mw3d5y1rql88i44eo/test?pretty=true' -d '{"test":"hello world"}' | |
{ | |
"ok":true, | |
"_index":"pw4mw3d5y1rql88i44eo", | |
"_type":"test", | |
"_id":"qKdnxB14R7OYTmiCdK2g2A", | |
"_version":1 | |
} | |
$ curl 'http://index.bonsai.io/pw4mw3d5y1rql88i44eo/test/_search?q=test:hello&pretty=true' | |
{ | |
"took" : 3, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 1, | |
"successful" : 1, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 1, | |
"max_score" : 0.19178301, | |
"hits" : [ { | |
"_index" : "pw4mw3d5y1rql88i44eo", | |
"_type" : "test", | |
"_id" : "qKdnxB14R7OYTmiCdK2g2A", | |
"_score" : 0.19178301, "_source" : {"test":"hello world"} | |
} ] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ELASTICSEARCH_URL or BONSAI_URL, etc?