Skip to content

Instantly share code, notes, and snippets.

@spinscale
Created July 10, 2015 14:04
Show Gist options
  • Save spinscale/90583f86bbd61acfcf9e to your computer and use it in GitHub Desktop.
Save spinscale/90583f86bbd61acfcf9e to your computer and use it in GitHub Desktop.
filter broken
PUT /foo/bar/1
{
"field1" : "foo",
"field2" : "foo"
}
PUT /foo/bar/2
{
"field1" : "bar",
"field2" : "bar"
}
PUT /foo/bar/3
{
"field1" : "foo",
"field2" : "bar"
}
GET /foo/bar/_search
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"field1": "foo",
"field2": "bar"
}
}
}
}
}
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "foo",
"_type": "bar",
"_id": "2",
"_score": 1,
"_source": {
"field1": "bar",
"field2": "bar"
}
},
{
"_index": "foo",
"_type": "bar",
"_id": "3",
"_score": 1,
"_source": {
"field1": "foo",
"field2": "bar"
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment