简体   繁体   中英

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 = 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 . 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 ? Is this the order, in which the documents where added to the index (eg in which they where returned by mysql during indexing)? Any other order?

its equivalent to this

@weight DESC, @id ASC

(an extended sort mode string)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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