- Download the Solr-4.10.2 release from Solr.
- Unzip .zip in some location(E:\Liferay\Integrations).It is Slor home directory.
- Copy the solr-4.10.2.war from Solr home dirctory\dist (E:\Liferay\Integrations\solr-4.10.2\dist) and paste it into E:\Liferay\Integrations\solr-4.10.2\example\solr.
- Open up the E:\Liferay\Integrations\solr-4.10.2\example\solr\collection1\conf\solrconfig.xml.
- It is recommended to run the Solr instance on seperate tomcat instance other than liferay tomcat.
- So for seperate tomact for solr download tomcat zip
- It is tomcat home folder(E:\Liferay\solr\apache-tomcat-7.0.50).
- In the tomcat home folder under config create directory tomcathome/Catalina/localhost,Under this directory create solr.xml file and copy the following content into the file and save it.
- Copy the jars from solr/example/lib/ext into your container's main lib directory. These jars will set up SLF4J and log4j. (E:\Liferay\solr\apache-tomcat-7.0.50\lib)
- Download the commons-logging jar also and paste in E:\Liferay\solr\apache-tomcat-7.0.50\lib.
- Now start tomcat and check that it is running without any error or not.
Replace
<dataDir>${solr.data.dir: ./solr/data}</dataDir>
by following
<dataDir>${solr.data.dir:E:\Liferay\Integrations\solr-4.10.2\example\solr\collection1\data}</dataDir>
<dataDir>${solr.data.dir: ./solr/data}</dataDir>
by following
<dataDir>${solr.data.dir:E:\Liferay\Integrations\solr-4.10.2\example\solr\collection1\data}</dataDir>
Note: The dataDir can also be temporarily overridden with the JAVA_OPTS environment variable prior to starting Tomcat
JAVA_OPTS="-Dsolr.data.dir=/Solr_Home/solr/example/solr/data"
<Context docBase="E:/Liferay/Integrations/solr-4.10.2/example/solr/solr-4.10.2.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="E:\Liferay\Integrations\solr-4.10.2\example\solr" override="true"/>
</Context>
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/apache-tomcat-7.0.50/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:8080/solr
Copy the Liferay_Home/apache-tomcat-7.0.50/webapps/solr-web/WEB-INF/conf/schema.xml file and paste it into E:\Liferay\Integrations\solr-4.10.2\example\solr\conf\ directory.
No comments:
Post a Comment