Building Solr &
Installing Solr instance on tomcat.
- Download Solr-1.3.0 release from Solr.
- Unzip .tar on some location. For eg. /opt/solr/
- Make /opt/solr/example/solr as a $SOLR_HOME.
- Copy apache-solr-1.3.0.war file from /opt/solr/dist and paste it into /opt/solr/example/solr.
- Open up the /opt/solr/example/solr/conf/solrconfig.xmlReplace<dataDir>${solr.data.dir: ./solr/data}</dataDir>by following<dataDir>${solr.data.dir:/opt/solr/example/solr/data}</dataDir>
Note:
The dataDir can also be temporarily
overridden with the JAVA_OPTS environment variable prior to starting Tomcat
export
JAVA_OPTS="$JAVA_OPTS
-Dsolr.data.dir=/opt/solr/example/solr/data"
- It is recommended to run the Solr instance on separate tomcat instance other than liferay tomcat.
- So for separate tomcat for solr, consider it here. $SOLR_TOMCAT
- Into $SOLR_TOMCAT/conf/Catalina/localhost , create one solr.xml file and copy following content into the file and save it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Context docBase="/opt/solr/example/solr/apache-solr-1.3.0.war" debug="0" crossContext="true"> | |
<Environment name="solr/home" type="java.lang.String" value="/opt/solr/example/solr" override="true"/> | |
</Context> |
- Now start tomcat and check that it is running without any error or not.
Integrating Solr plugin
with Liferay
- Download Solr plugin which is compatible with the Liferay version.
- Drop the plugin into $LIFERAY_HOME/deploy directory.
- Start liferay tomcat server. After started liferay tomcat, just stop both the tomcat servers (SOLR_TOMCAT and LIFERAY_TOMCAT).
- Openup the $LIFERAY_HOME/tomcat-6.0.18/webapps/solr-web/WEB-INF/classes/META-INF/solr-spring.xml
for bean id=”solrServer”
give the solar tomcat settings and save it.
for eg. http://localhost:8181/solr
- Copy the $LIFERAY_HOME/tomcat-6.0.18/webapps/solr-web/WEB-INF/conf/schema.xml file and paste it into /opt/solr/example/solr/conf/ directory.
Congratulation,
you have done!