Finding or configuring Solr home directory

user1328021 picture user1328021 · Jul 4, 2012 · Viewed 12.3k times · Source

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?

Note: Solr noob here -- ultimately just trying to get search working on the site

Answer

javanna picture javanna · Jul 4, 2012

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.