0

In my models, when I refer to SphinxSearch with defaults like:

from djangosphinx.models import SphinxSearch

class Blog(models.Model):
    ...
    search = SphinxSearh()

the fulltext search works fine. But when I give weights attribute as documented:

search = SphinxSearch(
    weights={'title': 10, 'body': 5, 'tags': 10}
)

searches raise: SphinxClient instance has no attribute 'SetFieldWeights'

I must be missing something obvious as I seem to be the only one with this problem after Googling. Any help is much appreciated.

skaffman
  • 398,947
  • 96
  • 818
  • 769
onurmatik
  • 5,105
  • 7
  • 42
  • 67

1 Answers1

4

This problem is coming due to version of sphinxapi, put

SPHINX_API_VERSION = 0x116

in your settings.py file. problem will get resolve.

Default version getting picked up is 0x107, which doesn't have implemented 'SetFieldWeights' function.

vips
  • 56
  • 1