【发布时间】:2012-09-18 17:38:36
【问题描述】:
我正在使用django-haystack 和solr 后端。我在模型中保存了三首歌曲。当我搜索q="Hello world"。它只显示一个结果。应该是三个。还复制了schema.xml 并更新了索引rebuild_index。我错过了什么吗?谢谢
- 你好世界
- 你好
- 世界
这是我的搜索索引。
class SongIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
title = indexes.EdgeNgramField(model_attr='title')
def get_model(self):
return Song
搜索查询
sqs = SearchQuerySet().models(Song).filter(title=AutoQuery('Hello World'))
更新:已尝试
sqs = SearchQuerySet().models(Song).filter(title='Hello World')
【问题讨论】:
标签: django solr django-haystack