dcramer / django-sphinx

A transparent layer for full-text search using Sphinx and Django
http://groups.google.com/group/django-sphinx
BSD 3-Clause "New" or "Revised" License
357 stars 122 forks source link

rankmode default value not set #21

Open dbrgn opened 13 years ago

dbrgn commented 13 years ago

In the sourcecode, I found

SPH_RANK_PROXIMITY_BM25 = 0 # default mode, (...)

But when not setting rankmode in my model, ranking does not occur, all weight values are set to 1.

dbrgn commented 13 years ago

Actually the default mode gets set to 2 (SPH_RANK_NONE).

>>> Company.search.query('UBS AG')._rankmode
2

That has a strong effect on search results.

Workaround is to set rankmode = u'SPH_RANK_PROXIMITY_BM25' in the model's SphinxSearch instance.