xapian - Django-haystack not updating index -
using django-haystack 2.0.0 , xapian-haystack 2.0.0, migrated code 1.1.5 said in docs. search_indexes.py looks like:
from haystack import indexes 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 entire index model updated.""" return self.get_model().objects.filter(visible=true)
but when go rebuild_index, says:
are sure wish continue? [y/n] y
removing documents index because said so. documents removed.
with verbosity:
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.
so, don't know why haystack doesn't index model.
you have add fields index, under "text" add:
post1 = indexes.charfield(model_attr='postfield1', null=true)
and in post_text.txt index file template:
{{object.post1}}
now should work.
Comments
Post a Comment