I'm using django-haystack (v 2.3.1) with solr (v 5.0.0) and pysolr (v 3.0.0). I've been following the tutorial, and have set up similar myapp/search_indexes.py
and search/indexes/myapp/mymodel_text.txt
files.
./manage.py build_solr_schema > schema.xml
works fine, and I have copied this to $SOLR_HOME/conf/schema.xml.
The problem occurs when I try ./manage.py rebuild_index
. First, I'm asked to confirm:
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 therebuild_index
command.
Are you sure you wish to continue? [y/N] y
Then, it fails:
Removing all documents from your index because you said so.
Failed to clear Solr index: [Reason: Error 404 Not Found]
All documents removed.
Indexing 6 stories
Failed to add documents to Solr: [Reason: Error 404 Not Found]
My connection settings are:
#settings.py
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://127.0.0.1:8983/solr',
},
}
If I navigate to this url I can see the solr admin page. I have made sure that port 8983 is open for solr (as well as 8000 for the Django development server).
I feel that I may not have provided enough connection information, but what else is there to check?
UPDATE:
Although I solved this problem there were more to come, which were all fixed by using solr (v.4.7.0) instead, as django-haystack isn't ready for solr 5 (there was an issue related to this but I can no longer find it on github.