0

I have read sphinx documentation and cant find an answer.

I have a sphinx index set up on 2 fields (title, description)

I would like ranking to be higher the more times a search term is present in one or both of the fields. For example: A search for "car"

Product A:
Title: Red car
Desc: good car


Product B:
Title: Green car
Desc: A really good car. The best car.

In the above example I would like product B to rank higher than A because "car" is present 2 times in its description. Currently they two items are ranked equally.

What settings do i need to adjust in Sphinx to get this to work?

Thanks for the help

4

1 回答 1

1

快速简单的方法是使用 SPH_RANK_WORDCOUNT

但是您可以通过使用自定义排名器http://sphinxsearch.com/docs/current.html#expression-ranker 例如使用 word_count 或 hit_count来获得更好的结果 。

于 2013-04-10T15:36:37.313 回答