You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark Beeby <mb...@cambridge.org> on 2013/02/12 13:54:28 UTC

Tag facet.query excludes are broken when group.facet=true - SOLR 4.1 Bug?

I'm trying to use facets alongside grouping, however when I ask SOLR to compute grouped facet counts (group.facet=true, see http://wiki.apache.org/solr/FieldCollapsing) it no longer honours facet.query excludes, however without this (group.facet=false) the exclude works again without any problems. Have I mis-understood the purpose of group.facet or is there, as it appears to me, a bug in SOLR 4.1?

Here is the simplest version of a query that shows the problem I'm having:

http://localhost:8080/wmp/product/select
?q=title_search:history
&rows=0
&fq={!tag=format}formatLegend:Paperback
&group=true
&group.field=titleCode
&group.limit=99999
&group.facet=true
&facet=true
&facet.query={!key=Paperback ex=format}formatLegend:Paperback
&facet.query={!key=Hardback ex=format}formatLegend:Hardback

This produces:
    <lst name="facet_queries">
        <int name="Paperback">1492</int>
        <int name="Hardback">0</int>
    </lst>

However just switching group.facet=false, the following is produced, showing the exclude appears to have been ignored previously:
    <lst name="facet_queries">
        <int name="Paperback">1492</int>
        <int name="Hardback">1361</int>
    </lst>
Anybody else tried using this combination of excludes, facet queries and grouping and got this working?

Kind Regards,
Mark