Search code examples
phpsphinx

Sphinx: incorrect relevance?


I have a project where user can search for electrical goods. Search is implemented with Sphinx(Note: Sphinx version is 2.0.4 and I can't update it)

For exmaple, we have a query Светильник Е27(lamp e27). Results are following enter image description here

As for me, results are not correct, because I think that results 6-11 are way more relevant than 1-5.

Is it possible to fix this issue?

P.S. Already tried to apply SPH_RANK_WORDCOUNT and SPH_RANK_SPH04 for ranking mode, but results are the same


Solution

  • Having now clarified in comments, can say

    1) Check what fields you have indexed for each document, it might be that Светильник is used a lot in those fields, so boost the ranking. Where you seem to want most of the ranking to be on the title. Could omit less relevant fields.

    2) You can also specifically make title play a bigger part in ranking with setFieldWeights().

    3) Finally can even specifically only match against title using extended match mode
    @title Светильник Е27 - the words would have to be in the title, so results 1-5 wouldn't even show.

    ... basically all about manipulating what fields match and used for ranking.