Question

I'm trying to integrate Haystack with Solr. When I try to build the index, I get an error "Unknown field django_id" from SOLR. What's causing this to happen?

Was it helpful?

Solution 2

The schema.xml was malformed as I had copied additional text from the console.

OTHER TIPS

You also get this error if you haven't given Solr the schema.xml file which Haystack generates for you, as explained here in the docs.

django-haystack.readthedocs.io/en/latest/tutorial.html#reindex

If you added new fields to your database and copied the generated XML files from Haystack, you might also be getting this error because you haven't restarted jetty/Tomcat/whatever server you are using. This solved it for me on Ubuntu and Jetty:

sudo /etc/init.d/jetty stop
sudo /etc/init.d/jetty start

(by the way, that would also be the same as simply doing this):

sudo service jetty restart

Or, if you are using tomcat, that would be

sudo service tomcat6 restart

Edit: (tested this with Tomcat, and it solved the same problem again, the same as with Jetty).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top