I want to calculate the number of facets for the facet query user interface, but I think I'm missing something because I cannot get the numbers I need using facet filters.
Here is an example. Given two facets with three possible terms in each aspect:
Colors: {red, yellow, blue} Notes: {do, re, mi}
When I search, the calculations for each term in the facet do not take into account the filters set in another aspect.
To illustrate:
[ ] All colors (18) [x] Red (10) [ ] Green (5) [ ] Blue (3) [ ] All notes (18) [ ] Do (5) [x] Re (7) [ ] Mi (6)
Note that the totals in each facet are summed with the total number of queries for the query, as if filters had not been set.
The behavior I want is the number on the Notes facet that takes into account the filter in the Colors column and vice versa. That is, the numbers for the conditions of the note must be added up to 10 (to match the red filter), and not 18.
Interestingly, the screenshot example in the docs uses the Linked In example, which actually demonstrates the behavior I want.
http://www.elasticsearch.org/guide/reference/api/search/facets/
I can get the result I want by restarting the query once for each term in each aspect (ugh), but I wonder if there is a way to get the same behavior as LinkedIn from the box by changing my query.
source share