我在“标签”字段上实现了提升;但是它没有以适当的方式对我的结果进行排名。
我的 search_indexes.py:
class ParagraphIndex(indexes.SearchIndex, indexes.Indexable):
text= indexes.CharField(document=True, use_template=True, boost=1.0)
tags= indexes.MultiValueField(boost=2.5)
def prepare_tags(self,object):
return [tag.tag for tag in object.tags.all()]
我的常规搜索适用于正确的字段。我已经多次运行 update_index 并且仍然得到相同的答案。任何帮助都感激不尽。如果需要更多信息,请告诉我!