7

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?

Braiam
  • 1
  • 11
  • 47
  • 78
user1328021
  • 9,110
  • 14
  • 47
  • 78

2 Answers2

4

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.

javanna
  • 59,145
  • 14
  • 144
  • 125
  • I have the same problem I dont know where to put my schema.xml, I tried http://127.0.0.1:8080/solr/admin (as i defined it in my HAYSTACK_SOLR_URL) but it gives me a 404 – Armance Nov 05 '12 at 16:08
  • In recent versions of tomcat-solr, solrconfig.xml, schema.xml, and (optionally) solr.xml can be found in the "conf" dir of solr.home. For example, in /usr/share/solr/conf (which is usually a symbolic link to /etc/solr/conf). – Ruxandra T. Oct 15 '14 at 14:54
1

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

Dehan
  • 4,818
  • 1
  • 27
  • 38