lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sokolov <>
Subject Re: facet.field counts when q includes field
Date Sun, 27 Apr 2014 23:02:54 GMT
On 4/27/2014 6:30 PM, Trey Grainger wrote:
>>> So my question basically is: which restrictions are applied to the docset
> from which (field) facets are computed?
> Facets are generated based upon values found within the documents matching
> your "q=" parameter and also all of your "fq=" parameters. Basically, if
> you do an intersection of the docsets from all "q=" and "fq=" parameters
> then you end up with the docset the facet calculations are based upon.
> When you say "if I add type=book, *no* documents match, but I get facet
> counts: { chapter=4 }", I'm not exactly sure what you mean. If you are
> adding "q=toto&type=book&facet=true&facet.field=type" then the problem is
> that the "type=book" parameter doesn't do anything... it is not a valid
> Solr parameter for filtering here. In this case, all 4 of your documents
> matching the "q=toto" query are still being returned, which is why the
> facet count for chapters is 4.
In fact my query looks like:


or without url encoding:

  q=fulltext_t:(toto) AND dc_type_s:(book) (directory_b:false)

default operator is AND

  ... so I don't think that the query is broken like you described?


View raw message