使用django-haystack 2.0.0和xapian-haystack 2.0.0,迁移了1.1.5中的所有代码,如docs中所述。 现在我search_indexes.py样子:Django-haystack没有更新索引
from haystack import indexes
from app.models import Post
class PostIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
def get_model(self):
return Post
def index_queryset(self, using=None):
"""Used when the entire index for model is updated."""
return self.get_model().objects.filter(visible=True)
但是,当我去rebuild_index,它说:
你确定要继续吗? [y/N] y
删除索引中的所有文档,因为您这样说。全部删除了 文件。
随着冗长:
Skipping '<class 'django.contrib.auth.models.Permission'>' - no index.
Skipping '<class 'django.contrib.auth.models.Group'>' - no index.
...
Skipping '<class 'app.models.Post'>' - no index.
所以,我不知道为什么大海捞针没有索引这种模式。
谢谢,我会试试这个。 – amureki 2014-03-07 10:36:35