SOLR 组数

发布于 12-14 20:58 字数 250 浏览 3 评论 0原文

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

此查询返回 2 个组,第一组有 1 个文档,第二组有 2 个文档。

作为回应,我看到文档计数(3),但没有组计数。 我怎样才能获得组的数量。

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 first group has 1 document and second group has 2 documents.

In response I see count of documents(3) but there is no counts of groups.
How can I get count of groups.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

静待花开2024-12-21 20:58:01

使用 group.ngroups=true 在响应中包含组数。

更多信息@http://wiki.apache.org/solr/FieldCollapsing

文档 -
group.ngroups - true/false
如果为 true,则包括与查询匹配的组数。默认为 false。

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

More info @ http://wiki.apache.org/solr/FieldCollapsing

Documentation -
group.ngroups - true/false
If true, includes the number of groups that have matched the query. Default is false.

樱花坊2024-12-21 20:58:01

对上述答案的一条评论是 100% 正确的,但有一个额外的条件!

您可以拥有:

group.main => '真实'

One comment to above answer that is 100% correct however there is extra condition!

You can not have:

group.main => 'true'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文