Django haystack search returning items that are excluded -
i have been having issues django-haystack , need help.
i run site indexes projects , projects in status should not seen, ie status='de'
, status='pr'
my current setup is.
from haystack.indexes import * haystack import site models import project class projectindex(realtimesearchindex): project_name = charfield(document=true, use_template=true) description = charfield(use_template=true, model_attr='description') location = charfield(use_template=true, model_attr='location') owner = charfield(model_attr='owner') def search(self): return project.objects.filter(status='ap').exclude(status='pr').exclude(status='de') def index_queryset(self): """used when entire index model updated.""" return project.objects.filter(status='ap').exclude(status='pr').exclude(status='de') def get_queryset(self): """used when entire index model updated.""" return project.objects.filter(status='ap').exclude(status='pr').exclude(status='de') def read_queryset(self): """used when entire index model updated.""" return project.objects.filter(status='ap').exclude(status='pr').exclude(status='de') site.register(project, projectindex)
i managed solve issue updating 1.1 1.2
then of sudden started receiving these caught variabledoesnotexist while rendering: failed lookup key [object] in u'none'
googled , found out items might have disappeared out of system , there handy command that.
now have cronjob following /usr/bin/python2.6 /www/mysite/manage.py update_index --remove
every few hours
Comments
Post a Comment