Re: JSON-Facet ignoring excludeTags when numFound is 0

2016-05-05 Thread Siddharth Modala
Thanks Yonik,

That fixed the issue. Will this experimental flag be removed from future
versions?

Is there any other webpage apart from your blog(which is btw really
awesome) where I can find more info on the new facet module(like info reg
the processEmpty flag e.t.c)?
On May 5, 2016 2:37 PM, "Yonik Seeley" <ysee...@gmail.com> wrote:

> On Thu, May 5, 2016 at 2:27 PM, Siddharth Modala
> <modalasiddha...@gmail.com> wrote:
> > Hi All,
> >
> > We are facing the following issue where Json Facet with excludeTag
> doesn't
> > return any results  when numFound=0, even though excluding the filter
> will
> > result in matching few docs. (Note: excludeTag works when numFound is >
> 0)
>
> Yeah, we perhaps need to be smarter at knowing when a 0 result could
> still yield useful sub-facets.
> For now, there is an experimental flag you can add to the facet block:
> processEmpty:true
>
> So in your case:
> json.facet={
>   processEmpty:true,
>   exCounts:{type:terms, field:group_id_s,limit=-1,
>  domain:{excludeTags:AMOUNT} },
>  }
>
> -Yonik
>


JSON-Facet ignoring excludeTags when numFound is 0

2016-05-05 Thread Siddharth Modala
Hi All,

We are facing the following issue where Json Facet with excludeTag  doesn't
return any results  when numFound=0, even though excluding the filter will
result in matching few docs. (Note: excludeTag works when numFound is > 0)

We are using Solr 5.4.1
For eg.

If we have the following data in Solr

acct_s,group_id_s,amt_td
A1, G1,100
A2, G1, 200
A3,G2,100
A4,G3, 100


and we make a solr query as follows

q=*:*={!tag='AMOUNT' }amt_td:[201 TO *]&
={
  exCounts:{type:terms, field:group_id_s,limit=-1,
domain:{excludeTags:AMOUNT} },
}

Result is numfound=0 and facet:[]

but clearly excluding the 'AMOUNT' filter will match all the documents.


This issue is not there in the normal facet module

eg.

 q=*:*={!tag='AMOUNT' }amt_td:[201 TO
*]=true={!ex=AMOUNT}group_id_s=-1

will return numFound=0
facet_counts:{
  facet_fields:{
  group_id_s:[
  G1,2
  G2,1
  G3,1
 ]
  }
   }


This issue shows up in a different form when we have our data distributed
on multiple shards in cloud mode.

Eg.
If the data is distributed as follows

Shard1 on node 1:

acct_s,group_id_s,amt_td
A1, G1,100
A3,G2,100


Shard2 on node2:

acct_s,group_id_s,amt_td
A2, G1, 200
A4,G3, 100

When we run the following query

Note: below fq will match one document

q=*:*={!tag='AMOUNT' }amt_td:[101 TO *]&
={
  exCounts:{type:terms, field:group_id_s, limit=-1,
domain:{excludeTags:AMOUNT} },
}

Will give

numFound=1
facets:{
  exCounts:{
   buckets:[{
  val:G1, count:1
  },{
  val:G3, count:1
  }]
  }
  }

We can clearly see that the counts of the groups are not as we would
expect. Thats because in Shard1 the above query has no matching docs so
json facet dint return any results from that shard. But Shard2 has one
matching doc and so the json facet module return some result.

Is this a bug? or this is the way the new json facet module is implemented.

Has anyone else faced something similar? did you find any work around for
this issue?

PS: We are using jsonFacet because of its performance benefits.