Solr 分组的替代基于分数的排序

发布于 2024-12-19 18:15:35 字数 1592 浏览 3 评论 0原文

目前,solr 分组 (http://wiki.apache.org/solr/FieldCollapsing) 对组进行排序“按照每组中顶部文档的分数”。例如,

[...]
"groups":[{
    "groupValue":"81cb63020d0339adb019a924b2a9e0c2",
    "doclist":{"numFound":9,"start":0,"maxScore":4.729042,"docs":[
        {
          "id":"7481df771afe39fab368ce19dfeeb528",
          [...],
          "score":4.729042},
        {
          "id":"c879e95b5f16343dad8b1248133727c2",
          [...],
          "score":4.6635237},
        {
          "id":"485b9aec90fd3ef381f013c51ab6a4df",
          [...],
          "score":4.347174}]
    }},
[...]

是否有一种开箱即用的方法可以按每个组内文档的分数总和对组进行排序?例如,

[...]
"groups":[{
    "groupValue":"81cb63020d0339adb019a924b2a9e0c2",
    "doclist":{"numFound":9,"start":0,"scoreSum":13.739738,"docs":[
        {
          "id":"7481df771afe39fab368ce19dfeeb528",
          [...],
          "score":4.729042},
        {
          "id":"c879e95b5f16343dad8b1248133727c2",
          [...],
          "score":4.6635237},
        {
          "id":"485b9aec90fd3ef381f013c51ab6a4df",
          [...],
          "score":4.347174}]
    }},
[...]

随着功能查询排序的发布(https://issues.apache.org/jira /browse/SOLR-1297),似乎应该有一种方法可以使用 sum() 函数(http://wiki.apache.org/solr/FunctionQuery)。但它还不够接近,因为“分数”字段不是文档的一部分。

我觉得我已经很接近了,但我错过了一些明显的部分。我正在使用 Solr 3.5 。

Currently, solr grouping (http://wiki.apache.org/solr/FieldCollapsing) sorts groups "by the score of the top document within each group". E.g.

[...]
"groups":[{
    "groupValue":"81cb63020d0339adb019a924b2a9e0c2",
    "doclist":{"numFound":9,"start":0,"maxScore":4.729042,"docs":[
        {
          "id":"7481df771afe39fab368ce19dfeeb528",
          [...],
          "score":4.729042},
        {
          "id":"c879e95b5f16343dad8b1248133727c2",
          [...],
          "score":4.6635237},
        {
          "id":"485b9aec90fd3ef381f013c51ab6a4df",
          [...],
          "score":4.347174}]
    }},
[...]

Is there an out-of-the-box way to instead sort groups by the sum of the scores of the documents within each group? E.g.

[...]
"groups":[{
    "groupValue":"81cb63020d0339adb019a924b2a9e0c2",
    "doclist":{"numFound":9,"start":0,"scoreSum":13.739738,"docs":[
        {
          "id":"7481df771afe39fab368ce19dfeeb528",
          [...],
          "score":4.729042},
        {
          "id":"c879e95b5f16343dad8b1248133727c2",
          [...],
          "score":4.6635237},
        {
          "id":"485b9aec90fd3ef381f013c51ab6a4df",
          [...],
          "score":4.347174}]
    }},
[...]

With the release of sorting by Function Query (https://issues.apache.org/jira/browse/SOLR-1297), it seems that there should be a way to use the sum() function (http://wiki.apache.org/solr/FunctionQuery). But it's not quite close enough since the "score" field is not part of the documents.

I feel like I'm close but I'm missing some obvious piece. I'm using Solr 3.5 .

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

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

发布评论

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

评论(1

家住魔仙堡 2024-12-26 18:15:35

看起来这个问题已经有一段时间了: https://issues.apache.org /jira/browse/SOLR-2072 。这正是我所说的。我必须跟进 Solr 人员。

Looks like this has been an open issue for a while: https://issues.apache.org/jira/browse/SOLR-2072 . This is exactly what I was talking about. I'll have to follow up with the Solr folks.

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