Liferay is widely used Open Source portal with wide variety of features. It manages content of various kind ex. Blogs , Wiki , User Information , Documents etc. In such case searching becomes one of the key aspect, by default liferay is bundled with lucene search indexer. From version 5.1.x liferay has made search engine pluggable and currently provides plugin integration with popular enterprise search engine Solr. In this blog I will share details about Solr , benefits of using solr in Liferay and solr-web (plugin to do integration between solr and liferay).
What is Solr?
Solr is an Open Source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, a web administration interface and many more features. It runs in a Java servlet container such as Tomcat.
Read More.
Why to use it in Liferay?
This is interesting question and following are few reasons to consider Solr over default Lucene used by Liferay.
- You can deploy Liferay in one server and have Solr running in a different server, this is very helpful for clustered portals because we got rid of racing issues when Lucene JDBC was used.
- Also, you can have a cluster of Solr instances that does load balancing of requests.
- Solr as an independent search server provides more flexibility and control.
What is solr-web plugin?
This web plugin will be responsible for integration between Liferay and Solr. It will implement indexing and searching functionality using Solr Core API. API exposed by solr-web will be used by Liferay core as soon as solr-web gets deployed. Solr does indexing based on definitions of fields and parameter provided in schema xml file. In solr-web plugin schema file has been provided specific for Liferay. You can get this plugin from Plugin Installer of Liferay.
Typical installation scenario will involve following steps.
- Install Liferay
- Install Solr (Configure solr home and Deploy solr war)
- Deploy and Configure solr-web plugin
- Test search using Control Panel and Search Portlet
By
Mahipalsinh Rana
Senior Consultant at CIGNEX, India Office