如何在solr中按“匹配所有文档"的顺序对结果进行排序?询问 [英] How are results ordered in solr in a "match all docs" query

查看:197
本文介绍了如何在solr中按“匹配所有文档"的顺序对结果进行排序?询问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用匹配所有文档"查询"*:*"(星号冒号星号)时,结果如何排序?

When I use a "match all docs" query, '*:*', asterisk colon asterisk, how are the results ordered?

我认为它们是按相关性排序的,但是在这种情况下,相关性是相等的,对吗?那么,有什么计划?

I presume they get ordered by relevancy, but the relevancy is equal in this case, right? So then, what's the scheme?

推荐答案

当两个文档的分数相同时,Lucene会按索引顺序对它们进行排序(第一个先被索引),以便运行两次查询将返回索引中的文档.相同的顺序.

When two documents have the same score, Lucene sorts them by index order (the first which has been indexed first) so that running a query twice returns documents in the same order.

由于 MatchAllDocsQuery 给出了所有文档的分数均保持不变,它将按索引顺序返回它们.

Since MatchAllDocsQuery gives a constant score to all documents, it returns them in index order.

这篇关于如何在solr中按“匹配所有文档"的顺序对结果进行排序?询问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆