Created
February 18, 2012 16:30
-
-
Save mattweber/1860066 to your computer and use it in GitHub Desktop.
This file contains 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
curl -XPUT 'http://localhost:9200/testing' -d '{ | |
"mappings" : { | |
"testa" : { | |
"_source" : { | |
"enabled" : true | |
}, | |
"properties" : { | |
"field1" : {"type" : "string", "store" : "yes"}, | |
"field2" : {"type" : "string", "store" : "yes"} | |
} | |
} | |
} | |
}' |
This file contains 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
{ | |
"took" : 62, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 2, | |
"max_score" : 0.30685282, | |
"hits" : [ { | |
"_index" : "testing", | |
"_type" : "testa", | |
"_id" : "1", | |
"_score" : 0.30685282, | |
"fields" : { | |
"field1" : "testa_field1", | |
"field2" : "testa_field2" | |
} | |
}, { | |
"_index" : "testing", | |
"_type" : "testb", | |
"_id" : "2", | |
"_score" : 0.30685282 | |
} ] | |
} | |
} |
This file contains 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
curl -XPUT 'http://localhost:9200/testing/testa/1' -d '{"field1":"testa_field1","field2":"testa_field2","field3":"findme"}' | |
curl -XPUT 'http://localhost:9200/testing/testb/2' -d '{"field1":"testb_field1","field2":"testb_field2","field3":"findme"}' |
This file contains 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
curl -XGET 'http://localhost:9200/testing/_search?q=field3:findme&fields=field1,field2&pretty=true' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment