31 August, 2012

Solr Integration

If you want to configure solr with liferay, just follow below steps :

I used solr-3.5 and it is indexing and searching as expected.

  1. Download and extract vanilla Liferay + Tomcat bundle to development directory such as C:\liferay-portal-6.1.0-ce-ga1
  2. Delete seven cogs folder from webapps
  3. Download solr.zip(http://lucene.apache.org/solr/), solr-web.zip(From Liferay plugin setup), apache-solr.zip(http://lucene.apache.org/solr/)
  4. Unzip apache-solr.zip to C:\liferay-portal-6.1.0-ce-ga1 Note: you can unzip to any location and change the path in solr-spring.xml. This has only the required files from apache-solr 3.5.
  5. unzip solr-web.zip & solr.zip under C:\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.27\webapps
  6. Copy solr.xml to C:\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23\conf\Catalina\localhost
  7. Modify solr.xml to point to the path of solr war file.
  8. Copy solr-spring.xml to C:\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.27\webapps\solr-web\WEB-INF\classes\META-INF
  9. Modify solr location to point to you solr url <bean id="com.liferay.portal.search.solr.server.BasicAuthSolrServer" class="com.liferay.portal.search.solr.server.BasicAuthSolrServer"><constructor-arg type="java.lang.String" value="http://localhost:8080/solr" /></bean>
  10. Modify setenv.bat to include solr home property set "JAVA_OPTS=%JAVA_OPTS%  -Dsolr.solr.home=C:\liferay-portal-6.1.0-ce-ga1\apache-solr\example\solr\ -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"
  11. Start portal
  12. Login test@liferay.com  and password:test

Rate Me:

0 Discussion: