简体   繁体   English

在Sphinx中使用SPH_SORT_RELEVANCE时,如何对权重相等的结果进行排序?

[英]How are results with equal weight sorted when using SPH_SORT_RELEVANCE in Sphinx?

I am using the following code to retrieve search results from Sphinx: 我正在使用以下代码从Sphinx检索搜索结果:

$sphinx = new SphinxClient();
$sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
$sphinx->SetRankingMode(SPH_RANK_SPH04);
$result = $sphinx->Query($query, $index);

This uses the default sorting of SPH_SORT_RELEVANCE . 这使用SPH_SORT_RELEVANCE的默认排序。 Everything fine. 一切都很好。

What I was wondering is, when all results have equal weights (eg by using a too general search term), in which order are these returned by Sphinx when using SPH_SORT_RELEVANCE ? 我想知道的是,当所有结果都具有相同的权重时(例如,通过使用过于笼统的搜索词),当使用SPH_SORT_RELEVANCE时,Sphinx SPH_SORT_RELEVANCE什么顺序返回这些SPH_SORT_RELEVANCE Is this the order, in which the documents where added to the index (eg in which they where returned by mysql during indexing)? 这是将文档添加到索引中的顺序吗(例如,在索引过程中mysql返回的文档)? Any other order? 还有其他命令吗?

its equivalent to this 相当于这个

@weight DESC, @id ASC

(an extended sort mode string) (扩展的排序模式字符串)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM