Created
March 2, 2011 16:00
-
-
Save clintongormley/851150 to your computer and use it in GitHub Desktop.
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
# [Wed Mar 2 16:59:10 2011] Protocol: http, Server: 127.0.0.1:9200 | |
curl -XPUT 'http://127.0.0.1:9200/foo/' -d ' | |
{ | |
"mappings" : { | |
"bar" : { | |
"properties" : { | |
"text" : { | |
"index" : "not_analyzed", | |
"type" : "string" | |
} | |
} | |
} | |
} | |
} | |
' | |
# [Wed Mar 2 16:59:10 2011] Response: | |
# { | |
# "ok" : true, | |
# "acknowledged" : true | |
# } | |
# [Wed Mar 2 16:59:13 2011] Protocol: http, Server: 127.0.0.1:9200 | |
curl -XPOST 'http://127.0.0.1:9200/_bulk' -d ' | |
{"index" : {"_index" : "foo", "_id" : 1, "_type" : "bar"}} | |
{"text" : "blue"} | |
{"index" : {"_index" : "foo", "_id" : 2, "_type" : "bar"}} | |
{"text" : "blue red"} | |
{"index" : {"_index" : "foo", "_id" : 3, "_type" : "bar"}} | |
{"text" : "red"} | |
' | |
# [Wed Mar 2 16:59:13 2011] Response: | |
# { | |
# "items" : [ | |
# { | |
# "index" : { | |
# "ok" : true, | |
# "_index" : "foo", | |
# "_id" : "1", | |
# "_type" : "bar", | |
# "_version" : 1 | |
# } | |
# }, | |
# { | |
# "index" : { | |
# "ok" : true, | |
# "_index" : "foo", | |
# "_id" : "2", | |
# "_type" : "bar", | |
# "_version" : 1 | |
# } | |
# }, | |
# { | |
# "index" : { | |
# "ok" : true, | |
# "_index" : "foo", | |
# "_id" : "3", | |
# "_type" : "bar", | |
# "_version" : 1 | |
# } | |
# } | |
# ], | |
# "took" : 2 | |
# } | |
# [Wed Mar 2 16:59:16 2011] Protocol: http, Server: 127.0.0.1:9200 | |
curl -XGET 'http://127.0.0.1:9200/foo/_search' -d ' | |
{ | |
"query" : { | |
"prefix" : { | |
"text" : "blue" | |
} | |
} | |
} | |
' | |
# [Wed Mar 2 16:59:17 2011] Response: | |
# { | |
# "hits" : { | |
# "hits" : [ | |
# { | |
# "_source" : { | |
# "text" : "blue" | |
# }, | |
# "_score" : 1, | |
# "_index" : "foo", | |
# "_id" : "1", | |
# "_type" : "bar" | |
# }, | |
# { | |
# "_source" : { | |
# "text" : "blue red" | |
# }, | |
# "_score" : 1, | |
# "_index" : "foo", | |
# "_id" : "2", | |
# "_type" : "bar" | |
# } | |
# ], | |
# "max_score" : 1, | |
# "total" : 2 | |
# }, | |
# "timed_out" : false, | |
# "_shards" : { | |
# "failed" : 0, | |
# "successful" : 5, | |
# "total" : 5 | |
# }, | |
# "took" : 2 | |
# } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment