0
我正在使用django-haystack
和solr
后端。我已经保存了三首歌曲。当我搜索q="Hello world"
。它只显示一个结果。它应该是三个。还复制schema.xml
并更新索引rebuild_index
。我错过了什么吗?感谢缺少结果django-haystack solr
- 的Hello World
- 你好
- 世界
这里是我的搜索索引。
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
SEARCHQUERY
sqs = SearchQuerySet().models(Song).filter(title=AutoQuery('Hello World'))
更新:试过
sqs = SearchQuerySet().models(Song).filter(title='Hello World')
我也试过。但没有运气。 – Kulbir
所以最后一件事:你在说什么这个SearchQuerySet返回或真的使用Haystack视图搜索术语“Hello World”? – jasisz
我不是在寻找确切的术语,也没有使用Haystack View。简单SearchQuerySet – Kulbir