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.
- 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!
hi amit does we need to follow same step in windows machine too.
ReplyDeletesorry for being late to reply .
ReplyDeleteyes hemant kumar.. we need to follow the same step in windows too.
Great Article
ReplyDeleteThanks for contribution.
Configured successfully.!
hi Amit,
ReplyDeleteI have configured above step...but how to index the data and see the result in Liferay
Hi Amith,
ReplyDeletei got the error,
SEVERE:error deploying configuration descriptor solr.xml
Tried integrating Solr 4.1.0 with liferay 6.1 and encountered errors.. i am looking for complete integration guidelines ... could you please suggest some important reference material...
ReplyDeleteWith Solr4 I expect that the Schema.xml should be changed
ReplyDeleteHi Umer,
ReplyDeleteI updated the Solr.xml , now it will not face the issue.
SHRIHARSH & thePanz
ReplyDeleteStill I have not gone through solr 4.1. But I think Steps should remain the same.
Thanks
Hi Amit,
ReplyDeleteI gone through this step with Windows and it's working fine.
Configure successfully......
Thank you for sharing
Hi Amit,
ReplyDeleteI followed your steps and when i start servers not seeing any errors but reindexing throuh control panel still using luceneindexer and not seeing any activity under solr plugin. Can you please tell me whats wrong.
Liferay version: 6.1.1CE GA2
Solr: 1.3.0
Plugin: solr-web-6.1.0.1-ce-ga1-20120106155615760.war