7
votes

I'm following this tutorial on setting up django-haystack and solr: http://django-haystack.readthedocs.org/en/latest/tutorial.html

I hit a stumbling block here:

If you’re using the Solr backend, you have an extra step. Solr’s configuration is XML-based, so you’ll need to manually regenerate the schema. You should run ./manage.py build_solr_schema first, drop the XML output in your Solr’s schema.xml file and restart your Solr server.

Where is my schema.xml file located? It says it should in the Solr home directory and the .conf folder. But where is the Solr home directory, and/or how do I configure its location?

2
May I know if the answer was helpful? If so, you might want to accept it.javanna

2 Answers

4
votes

The solr home is the place where you can find your schema.xml and solrconfig.xml, as well as some other files depending on the text analysis you're using (dictionaries for stemming, stopwords etc.), and where your index gets created by default.

There are a couple of ways to configure the solr home, since it is located outside of the servlet container:

  • solr.solr.home java system property (most used one)
  • java:comp/env/solr/home for JNDI lookup

You can either check your servlet container configuration or go to the Solr admin page http://host:port/solr/admin, which prints out the actual solr home location together with other information about the solr instance running.

1
votes

First check whether your Solr instance is working. Got to -> http://localhost:8983/solr

If you can see a Solr web panel you have a live Solr instance. Now go to Java Properties Solr Java Properties Link

Here you will see the the variables. This is where you can find the home DIRs enter image description here

Note schema is now managed. If you want to override this you will have to hack it a bit. check here