Created
February 15, 2016 21:37
-
-
Save mzikherman/106bf6c4307fd5c177f6 to your computer and use it in GitHub Desktop.
ES faceted working
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
{ | |
"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