Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding or configuring Solr home directory

Tags:

solr

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?

like image 281
user1328021 Avatar asked Jul 04 '12 16:07

user1328021


People also ask

Where is Solr home directory?

When you first install Solr, your home directory is server/solr . However, some examples may change this location (such as, if you run bin/solr start -e cloud , your home directory will be example/cloud ). The home directory contains important configuration information and is the place where Solr will store its index.

Which file contains configuration for Solr data directory?

The solrconfig. xml file is the configuration file with the most parameters affecting Solr itself.

What is Solr configuration?

Solr has several configuration files that you will interact with during your implementation. Many of these files are in XML format, although APIs that interact with configuration settings tend to accept JSON for programmatic access as needed.


2 Answers

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.

like image 110
javanna Avatar answered Sep 28 '22 12:09

javanna


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

like image 25
Dehan Avatar answered Sep 28 '22 11:09

Dehan