-
-
Save gjb83/22581de7fe8179325a5a to your computer and use it in GitHub Desktop.
How can I exclude the price filter from the calculation of the price_ranges facet?
In other words, the price_ranges facet should take into account all of the filters except for price.
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
{ | |
query : { | |
"filtered" : { | |
"query" : { | |
"match_all" : {} | |
}, | |
"filter" : { | |
"and" : [ | |
{ | |
"term" : { | |
"colour" : "Red" | |
} | |
}, | |
{ | |
"term" : { | |
"feature" : "Square" | |
} | |
}, | |
{ | |
"term" : { | |
"feature" : "Shiny" | |
} | |
}, | |
{ | |
"range" : { | |
"price" : { | |
"from" : "10", | |
"to" : "20" | |
} | |
} | |
} | |
] | |
} | |
} | |
}, | |
"facets" : { | |
"colours" : { | |
"terms" : { | |
"field" : "colour" | |
} | |
}, | |
"features" : { | |
"terms" : { | |
"field" : "feature" | |
} | |
}, | |
"price_ranges" : { | |
"statistical" : { | |
"field" : "price" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment