Posts Tagged ‘Apache SOLR Lucene’

Things you will need on hand –
Apache Tomcat [version 7.0.20 used here]
Latest SOLR Release [3.4.0 used here]

1. Install Tomcat with $TOMCAT_HOME environement variable set.
2. Edit $TOMCAT_HOME\conf\server.xml and add the attribute – URIEncoding=”UTF-8″.
The modified portion of server.xml should look like :
<Connector port=”8080″ protocol=”HTTP/1.1″
redirectPort=”8443″ URIEncoding=”UTF-8″/>

SOLR uses UTF-8 file encoding and thus we need to make sure that Apache Tomcat will be informed that all requests and responses made should use that encoding.

3. Create a proper context file [solr.xml] under $TOMCAT_HOME\conf\Catalina\localhost. The content of the file should look like:
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<Context path=”/solr”>
<Environment name=”solr/home” type=”java.lang.String” value=”D:\solr” override=”true” />

This context definition helps to say that SOLR application will be available under /solr context with the SOLR home folder configuration. The SOLR home folder is where we need to place SOLR configuration files.

4. Now deploy solr.war into $TOMCAT_HOME\webapps. If you need some additional libraries for Solr to see, you should add them to the $TOMCAT_HOME/lib directory.

5. Now its time to add SOLR configuration files [solrconfig.xml, schema.xml,elevate.xml] to solr/home folder. Please don’t forget that you need to ensure the proper directory structure. If you are not familiar with the Solr directory structure, please take a look at the example deployment that is provided with standard Solr package.

6. Now start tomcat and hit the URL: :     http://localhost:8080/solr/admin/  to view the Admin console.

If you followed exactly the above steps mentioned then —

Congratulations, you have just successfully configured and ran the Apache Tomcat servlet container with Solr deployed.


Read Full Post »