When I looked at this in solr 5.5.3 The second phase of the query was only sent to the shards that returned documents in the first phase, the problem is that one shard may contain matching documents in a group but ranked outside the top N results.
Fatduo this solution won't help you unless you are looking at changing some solr code, but is to help with Diego point that maby this could be fixed(as a starting point to look at as the code may have changed in 7.0). We changed the grouping code to search all shards on the second phase. (I think that this was all that was needed but we changed grouping to be two level so lots of change is grouping code) In the 5.5.3 code base we changed the method construceRequest(ResponseBuilder rb) in TopGroupsShardRequestFactory to always call createRequestForAllShards(rb) Ian NLA -----Original Message----- From: Diego Ceccarelli (BLOOMBERG/ LONDON) <dceccarel...@bloomberg.net> Sent: Friday, 4 May 2018 9:37 PM To: solr-user@lucene.apache.org Subject: Re:the number of docs in each group depends on rows Hello, I'm not sure 100% but I think that if you have multiple shards the number of docs matched in each group is *not* guarantee to be exact. Increasing the rows will increase the amount of partial information that each shard sends to the federator and make the number more precise. For exact counts you might need one shard OR to make sure that all the documents in the same group are in the same shard by using document routing via composite keys [1]. Thinking about that, it should be possible to fix grouping to compute the exact numbers on request... cheers, Diego [1] https://lucene.apache.org/solr/guide/6_6/shards-and-indexing-data-in-solrcloud.html#shards-and-indexing-data-in-solrcloud From: solr-user@lucene.apache.org At: 05/04/18 07:53:41To: solr-user@lucene.apache.org Subject: the number of docs in each group depends on rows Hi, We used Solr Cloud 7.1.0(3 nodes, 3 shards with 2 replicas). When we used group query, we found that the number of docs in each group depends on the rows number(group number). difference: <http://lucene.472066.n3.nabble.com/file/t494000/difference.jpeg> when the rows bigger then 5, the return docs are correct and stable, for the rest, the number of docs is smaller than the actual result. Could you please explain why and give me some suggestion about how to decide the rows number? -- Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html