Bad*_*ach 7 django-haystack elasticsearch
我在'tags'字段上实现了一个提升; 但是它没有以适当的方式对我的结果进行排名.
我的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()]
Run Code Online (Sandbox Code Playgroud)
我的常规搜索适用于正确的字段.我已经多次运行update_index并仍然得到相同的答案.任何帮助都感激不尽.如果需要更多信息,请告诉我!