Re: JSON Facet "allBuckets" behavior

2016-10-06 Thread prosens
Yonik,
Here is the requirement:
Get sum of size field for all the documents which has a duplicate in the
index. Duplicate is decided based on a string field. So, we are looking for
something like this.
{
"Statistics": {
"type": "terms",
"field": "filename",
"mincount": 2,
"numBuckets": true, 
*"sumBuckets": true*
}
}

Is their an alternate way to achieve this?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/JSON-Facet-allBuckets-behavior-tp4298289p4299980.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: JSON Facet "allBuckets" behavior

2016-10-03 Thread Karthik Ramachandran
So if i cannot use allBuckets since its not filtering, how can I achieve
this?

On Fri, Sep 30, 2016 at 7:19 PM, Yonik Seeley  wrote:

> On Tue, Sep 27, 2016 at 12:20 PM, Karthik Ramachandran
>  wrote:
> > While performing json faceting with "allBuckets" and "mincount", I not
> sure if I am expecting a wrong result or there is bug?
> >
> > By "allBucket" definition the response, representing the union of all of
> the buckets.
> [...]
> > I was wonder, why the result is not this, since I have "mincount:2"
>
> allBuckets means all of the buckets before limiting or filtering (i.e.
> mincount filtering).
>
> -Yonik
>


Re: JSON Facet "allBuckets" behavior

2016-09-30 Thread Yonik Seeley
On Tue, Sep 27, 2016 at 12:20 PM, Karthik Ramachandran
 wrote:
> While performing json faceting with "allBuckets" and "mincount", I not sure 
> if I am expecting a wrong result or there is bug?
>
> By "allBucket" definition the response, representing the union of all of the 
> buckets.
[...]
> I was wonder, why the result is not this, since I have "mincount:2"

allBuckets means all of the buckets before limiting or filtering (i.e.
mincount filtering).

-Yonik


RE: JSON Facet "allBuckets" behavior

2016-09-29 Thread Karthik Ramachandran
Can someone help me understand?

With Thanks & Regards
Karthik Ramachandran

From: Karthik Ramachandran
Sent: Tuesday, September 27, 2016 12:21 PM
To: solr-user 
Subject: JSON Facet "allBuckets" behavior

While performing json faceting with "allBuckets" and "mincount", I not sure if 
I am expecting a wrong result or there is bug?

By "allBucket" definition the response, representing the union of all of the 
buckets.

Schema:




Dataset:
  1filename11
  2filename21
  3filename31
  4filename41
  5filename51
  6filename11
  7filename21
  8filename31
  9filename41
  10filename11
  11filename21
  12filename31
  13filename11
  14filename21
  15filename11

For my dataset, with request
http://localhost:8983/solr/jasonfacettest/select/?q=*:*=0= 
{"sumOfDuplicates":{"type":"terms","field":"filename","mincount":2,"numBuckets":true,"allBuckets":true,"sort":"sum
 desc","facet":{"sum":"sum(size)"}}}

below is the response,
"response":{"numFound":15,"start":0,"docs":[]},"facets":{"count":15,"sumOfDuplicates":{"numBuckets":4,"allBuckets":{"count":15,"sum":15.0},"buckets":[{"val":"filename1","count":5,"sum":5.0},{"val":"filename2","count":4,"sum":4.0},{"val":"filename3","count":3,"sum":3.0},{"val":"filename4","count":2,"sum":2.0}]}}}

I was wonder, why the result is not this, since I have "mincount:2"
"response":{"numFound":15,"start":0,"docs":[]},"facets":{"count":15,"sumOfDuplicates":{"numBuckets":4,"allBuckets":{"count":14,"sum":14.0},"buckets":[{"val":"filename1","count":5,"sum":5.0},{"val":"filename2","count":4,"sum":4.0},{"val":"filename3","count":3,"sum":3.0},{"val":"filename4","count":2,"sum":2.0}]}}}

Thanks for the help!!

With Thanks & Regards
Karthik Ramachandran
P Please don't print this e-mail unless you really need to