If your issue is that you want to retrieve the number of groups, group.ngroups will return the sum of the number of groups per shard.
This is not the number of groups overall as there if some groups are present on more than one shard. To make sure that this does not happen, one can choose to distribute documents so that all the documents with the same group key goes to the same shard. (Disclaimer : Before doing so, you need to make sure that your documents will still be spread about equally.) You can check out how to do that here https://cwiki.apache.org/confluence/display/solr/Shards+and+Indexing+Data+in+SolrCloud On Wed, Jul 31, 2013 at 8:02 PM, Ali, Saqib <docbook....@gmail.com> wrote: > Hello Paul, > > Can you please explain what you mean by: > "To get the exact number of groups, you need to shard along your grouping > field" > > Thanks! :) > > > On Wed, Jul 31, 2013 at 3:08 AM, Paul Masurel <paul.masu...@gmail.com > >wrote: > > > Do you mean you get different results with group=true? > > numFound is supposed returns the number of ungrouped hits. > > > > To get the number of groups, you are expected to set > > set group.ngroups=true. > > Even then, the result will only give you an upperbound > > in a distributed environment. > > To get the exact number of groups, you need to shard along > > your grouping field. > > > > If you have many groups, you may also experience a huge performance > > hit, as the current implementation has been heaviy optimized for low > > number of groups (e.g. e-commerce categories). > > > > Paul > > > > > > > > On Wed, Jul 31, 2013 at 1:59 AM, Ali, Saqib <docbook....@gmail.com> > wrote: > > > > > Hello all, > > > > > > Is anyone experiencing issues with the numFound when using group=true > in > > > SolrCloud 4.4? > > > > > > Sometimes the results are off for us. > > > > > > I will post more details shortly. > > > > > > Thanks. > > > > > > > > > > > -- > > ______________________________________________ > > > > Masurel Paul > > e-mail: paul.masu...@gmail.com > > > -- ______________________________________________ Masurel Paul e-mail: paul.masu...@gmail.com