Trouble searching with django-haystack facing error – undefined field django_ct-Collection of common programming errors
I am totally new to django haystack and i am facing troubles getting started with it.
when i search i get error
Failed to query Solr using '*:*': [Reason: Error 400 undefined field django_ct]
when i rebuild index i get this error
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'. Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
ERROR:root:Error updating votingapp using default
Traceback (most recent call last):
...
...
index_qs = self.index_queryset(using=using)
TypeError: index_queryset() got an unexpected keyword argument 'using'
I have set up a simple index class
class QuestionsIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
qs = indexes.CharField(model_attr='question')
def get_model(self):
return Questions
def index_queryset(self):
return self.get_model().objects.all()
added code in settings.py
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://127.0.0.1:8983/solr'
# ...or for multicore...
# 'URL': 'http://127.0.0.1:8983/solr/mysite',
},
}
added the url
url(r'^search/', include('haystack.urls')),
view code
def home(request):
if request.method == "POST":
print SearchQuerySet().all()
return render_to_response('search.html',{})
Kindly advise where am i doing wrong