Skip to content

Instantly share code, notes, and snippets.

@gibrown
Created December 18, 2012 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gibrown/4323746 to your computer and use it in GitHub Desktop.
Save gibrown/4323746 to your computer and use it in GitHub Desktop.
ES fails when match_all filter uses an empty array with a faceted search.
SERVER="http://localhost:9200"
curl -XPUT "$SERVER/bugs/page/8872248-p-145" -d '{"id":145,"url":"http://alexsandbox.wordpress.com/header-test/","date":"2010-02-06 05:23:27","date_gmt":"2010-02-06 05:23:27","author":"Alex Mills","author_login":"viper007bond","title":"Header Test","content":"asdfasd as sad f","category":"Uncategorized","meta":{"_edit_lock":["1337928058:50392"],"_edit_last":["50392"],"_thumbnail_id":["147"]},"meta_raw":{"_edit_lock":["1337928058:50392"],"_edit_last":["50392"],"_thumbnail_id":["147"]}}'
curl -XGET "$SERVER/bugs/_search?pretty" -d '
{
"query":{"filtered":{"query":{"multi_match":{"query":"automattic","fields":["title","content"]}},"filter":{"match_all":{}}}},
"facets" : {
"tag" : {
"terms" : {
"field" : "tag",
"size" : 10
}
}
}
}'
curl -XGET "$SERVER/bugs/_search?pretty" -d '
{
"query":{"filtered":{"query":{"multi_match":{"query":"automattic","fields":["title","content"]}},"filter":{"match_all":[]}}},
"facets" : {
"tag" : {
"terms" : {
"field" : "tag",
"size" : 10
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment