Number of SOLR Groups

http://localhost:8080/solr/select?q=(apposta apposta per) OR (sue prime ore al)&group=true&group.field=grouping_field&group.limit=5

This query returns 2 groups. The first group has 1 document, and the second group has 2 documents.

In response, I see the number of documents (3), but no groups. How can I get the number of groups.

+4
source share
2 answers

Use group.ngroups=true to indicate the number of groups in the response.

Read more @ http://wiki.apache.org/solr/FieldCollapsing

Documentation -
group.ngroups - true / false
If true, includes the number of groups that match the query. The default value is false.

+13
source

One comment on the answer above, which is 100% correct, however there is an additional condition!

You may not have:

group.main => 'true'

+3
source

Source: https://habr.com/ru/post/1380564/


All Articles