Created
July 8, 2012 12:49
-
-
Save dedico/3070809 to your computer and use it in GitHub Desktop.
incorrect elasticsearch query
This file contains hidden or 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":{ | |
"bool":{ | |
"must":[ | |
{ | |
"match_all":{ } | |
}, | |
{ | |
"term":{ | |
"vehicles.vehicle_category_id":{ | |
"term":"1" | |
} | |
} | |
}, | |
{ | |
"term":{ | |
"vehicles.make_id":{ | |
"term":"71" | |
} | |
} | |
}, | |
{ | |
"term":{ | |
"vehicles.model_id":{ | |
"term":"1819" | |
} | |
} | |
} | |
] | |
} | |
}, | |
"facets":{ | |
"power":{ | |
"terms":{ | |
"field":"vehicles.power_km", | |
"size":1000, | |
"all_terms":true | |
} | |
}, | |
"capacity":{ | |
"terms":{ | |
"field":"vehicles.engine_capacity", | |
"size":1000, | |
"all_terms":false, | |
"facet_filter":{ | |
"term":{ | |
"vehicles.power_km":"105" | |
} | |
} | |
} | |
} | |
}, | |
"filter":{ | |
"and":[ | |
{ | |
"term":{ | |
"vehicles.power_km":"105" | |
} | |
}, | |
{ | |
"term":{ | |
"vehicles.engine_capacity":"1781" | |
} | |
} | |
] | |
}, | |
"size":30, | |
"from":0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to apply facet filter (https://gist.github.com/3070809) on 'capacity' facet, I get incorrect results - looks like the query is ignoring the filter for some reason....