I'm trying to understand the facet counts I'm getting back from Solr
when the main query includes a term that restricts on a field that is
being faceted. After reading the docs on the wiki (both wikis) I'm
confused.
In my little test dataset, if I facet on "type" and use q=*:*, I get
facet counts for type: [ chapter=5, book=1 ]
With q=toto, only four of the chapters match, so I get facet counts for
type: { chapter=4 } .
Now if I add type=book, *no* documents match, but I get facet counts: {
chapter=4 }.
It's as if the type term from the query is being ignored when the facets
are computed. This is actually what we want, in general, but the
documentation doesn't reflect it and I'd like to understand better the
mechanism so I can tell what I can rely on.
I see that there is the possibility of tagging and excluding filters
(fq) so they don't effect the facet counting, but there's no mention on
the wiki of any sort of term exclusion from the main query. I poked
around in the source a bit, but wasn't able to find an answer quickly,
so I thought I'd ask here.
So my question basically is: which restrictions are applied to the
docset from which (field) facets are computed?
-Mike
- facet.field counts when q includes field Michael Sokolov
-