Yago Riveiro
Yago Riveiro

Reputation: 727

Count distinct groups in distributed grouping in Solr

Is there any way to get the number of distinct groups in a distributed grouping in solr?

The ngroups param returns the summatory of all groups. If a group exists in more than one shard I will have repeated this groups in the ngroups.

Upvotes: 0

Views: 404

Answers (2)

Simon
Simon

Reputation: 2960

There are a few solutions to this now:

http://yonik.com/solr-count-distinct/

You can use the stats component with pivot faceting, use group with group.facet or use the new analytics API that shipped in 5.2 (5.1. didn't seem to work when I tried it).

Upvotes: 0

Jayendra
Jayendra

Reputation: 52779

Check SOLR-3316 and SOLR-3436.
May be an existing issue which is fixed.

Upvotes: 1

Related Questions