Skip to content

Instantly share code, notes, and snippets.

@rkroll
Created March 21, 2013 18:09
Show Gist options
  • Save rkroll/5215263 to your computer and use it in GitHub Desktop.
Save rkroll/5215263 to your computer and use it in GitHub Desktop.
ES-array-field-query
curl -XPUT 'http://localhost:9200/demo/index/loc' -d '{
"locations" : [
"Oakland Park, FLORIDA",
"33309",
"Florida"
]
}'
curl -XGET 'http://localhost:9200/demo/_search?' -d '
{
"from": 0,
"size": 25,
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"query": {
"bool": {
"should": {
"field": {
"locations": "\"Florida\""
}
}
}
}
}
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment