Share

Integrating Solr with liferay in windows


  1. Download the Solr-4.10.2 release from Solr.
  2. Unzip .zip in some location(E:\Liferay\Integrations).It is  Slor home directory.
  3. 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.
  4. Open up the E:\Liferay\Integrations\solr-4.10.2\example\solr\collection1\conf\solrconfig.xml.   

  5. 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>

      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"




  6. It is recommended to run the Solr instance on seperate tomcat instance other than liferay tomcat.
  7. So for seperate tomact for solr download  tomcat zip
  8. It is tomcat home folder(E:\Liferay\solr\apache-tomcat-7.0.50).
  9. 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.


  10. <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>




  11. 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)
  12. Download the commons-logging jar also and paste in E:\Liferay\solr\apache-tomcat-7.0.50\lib.
  13. Now start tomcat and check that it is running without any error or not.

  14.                                                   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