SOLR web plugin for Liferay 5.2.3 SE and SOLR server 1.4

The original post (in spanish) is found here

Some time ago we wrote a post about SOLR and Liferay. In that moment, we saw quite interesting the idea of using an external server for the indices when dealing with high availability systems. We checked that the official version only worked for specific versions of SOLR and Liferay. There exists an official version of the web plugin for SOLR 1.4 and Liferay 5.2.0 , that fails when used with Liferay 5.2.3 SE. So, we made some minor changes on the web plugin source for Liferay 5.2.3 SE (Community) and SOLR 1.4.1. Some technical details are given here:

  • Added the constant, public static final String COMMAND_INDEX_ONLY = "INDEX_ONLY", in the utils class. It seems that this constant is not included in the interface from the 5.1 to 5.2 version of the portal. Maybe, some messages are not available with this command, but anyway the constant is added in the plugin.
  • Added an explicit cast for the method isIndexReadOnly().
  • Added a validation if not null in the search method if(sortField.getFieldName() != null
  • Modified the dependencies and the libs for using the new packed versions of SOLR 1.4.1, and the existing dependencies in the portal.

         portal-dependency-jars=\
            commons-codec.jar,\
            commons-httpclient.jar,\
            commons-io.jar,\
            slf4j-api.jar,\
            slf4j-log4j12.jar,\
            spring.jar


         y en el lib del plugin:
           apache-solr-solrj-1.4.1.jar
           jcl-over-slf4j-1.5.5.jar
     

With these minor changes, the portal uses the SOLR server indices and no errors are logged related to indexing nor searching. It is important to remark that it is not fully tested. Here is a download link to the modified version of the web plugin.

Links and discussions related:

 

00

More Blog Entries

0 Comments