Skip to content

Instantly share code, notes, and snippets.

@mzikherman
Created February 15, 2016 21:37
Show Gist options
  • Save mzikherman/106bf6c4307fd5c177f6 to your computer and use it in GitHub Desktop.
Save mzikherman/106bf6c4307fd5c177f6 to your computer and use it in GitHub Desktop.
ES faceted working
{
"fields" : ["id"],
"query" : { "match_all" : {} },
"filter" : {
"bool" : {
"must" : [{"term" : {"colors" : "red" } }, {"term" : {"published" : true} }, {"and" : [{"term" : {"genes" : "Installation"}}]}]
}
},
"aggregations" : {
"medium" : {
"filter" : {
"bool" : {
"must" : [{"term" : {"colors" : "red" } }, {"term" : {"published" : true} } ]
}
},
"aggregations" : {
"medium_buckets" : {
"terms" : {
"field" :"genes", "include":["Painting", "Photography", "Sculpture", "Work on Paper", "Prints", "Drawing", "Performance Art", "Film/Video", "Installation", "Design", "Jewelry"], "size" : 11
}
}
}
},
"color" : {
"filter" : {
"bool" : {
"must" : [{"and" : [{"term" : {"genes" : "Installation"}}]}, {"term" : {"published" : true} } ]
}
},
"aggregations" : {
"color_buckets" : {
"terms" : {
"field" :"colors", "size" : 11
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment