{"id":6860,"date":"2014-05-07T13:08:09","date_gmt":"2014-05-07T13:08:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/07\/trouble-searching-with-django-haystack-facing-error-undefined-field-django_ct-collection-of-common-programming-errors\/"},"modified":"2014-05-07T13:08:09","modified_gmt":"2014-05-07T13:08:09","slug":"trouble-searching-with-django-haystack-facing-error-undefined-field-django_ct-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/07\/trouble-searching-with-django-haystack-facing-error-undefined-field-django_ct-collection-of-common-programming-errors\/","title":{"rendered":"Trouble searching with django-haystack facing error &#8211; undefined field django_ct-Collection of common programming errors"},"content":{"rendered":"<p>I am totally new to django haystack and i am facing troubles getting started with it.<\/p>\n<p>when i search i get error<\/p>\n<pre><code>Failed to query Solr using '*:*': [Reason: Error 400 undefined field django_ct]\n<\/code><\/pre>\n<p>when i rebuild index i get this error<\/p>\n<pre><code>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.\nAre you sure you wish to continue? [y\/N] y\nRemoving all documents from your index because you said so.\nAll documents removed.\nERROR:root:Error updating votingapp using default\nTraceback (most recent call last):\n...\n...\nindex_qs = self.index_queryset(using=using)\nTypeError: index_queryset() got an unexpected keyword argument 'using'\n<\/code><\/pre>\n<p>I have set up a simple index class<\/p>\n<pre><code>class QuestionsIndex(indexes.SearchIndex, indexes.Indexable):\ntext = indexes.CharField(document=True, use_template=True)\nqs = indexes.CharField(model_attr='question')\n\ndef get_model(self):\n    return Questions\ndef index_queryset(self):\n    return self.get_model().objects.all()\n<\/code><\/pre>\n<p>added code in settings.py<\/p>\n<pre><code>HAYSTACK_CONNECTIONS = {\n'default': {\n    'ENGINE': 'haystack.backends.solr_backend.SolrEngine',\n    'URL': 'http:\/\/127.0.0.1:8983\/solr'\n    # ...or for multicore...\n    # 'URL': 'http:\/\/127.0.0.1:8983\/solr\/mysite',\n},\n}\n<\/code><\/pre>\n<p>added the url<\/p>\n<pre><code>url(r'^search\/', include('haystack.urls')),\n<\/code><\/pre>\n<p>view code<\/p>\n<pre><code>def home(request):\nif request.method == \"POST\":\n    print SearchQuerySet().all()\nreturn render_to_response('search.html',{})\n<\/code><\/pre>\n<p>Kindly advise where am i doing wrong<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;*:*&#8217;: [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 &#8216;default&#8217;. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6860","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6860"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6860\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}