为RT指数设置Sphinx相关性排名

时间:2017-05-21 15:21:21

标签: sphinx

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

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

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

Sphinx doc: http://sphinxsearch.com/blog/2010/08/17/how-sphinx-relevance-ranking-works/

1 个答案:

答案 0 :(得分:2)

默认排名模式为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

相关问题