为 RT 索引设置 Sphinx 相关性排名

Set Sphinx relevance ranking for RT index

如何在 Sphinx RT 查询中包含排名类型(例如 SPH_RANK_NONE)?

select id from my_index where match('hello') 
order by date
limit 600 ;  

另外,有没有办法只设置一次,例如在配置文件中?

斯芬克斯文档: http://sphinxsearch.com/blog/2010/08/17/how-sphinx-relevance-ranking-works/

默认排名模式为SPH_RANK_PROXIMITY_BM25,无法使用配置更改。

这是您为查询设置排名模式的方式(请注意 ORDER BY 必须具有明确的 ASC/DESC 顺序子句):

SELECT id FROM my_index where MATCH('hello') 
     ORDER BY date DESC LIMIT 600 OPTION ranker=sph04;

文档中的相关部分:

http://sphinxsearch.com/docs/current.html#weighting http://sphinxsearch.com/docs/current.html#sphinxql-select