Legacy Knowledge Base
Published Jul. 2, 2025

Setting up Solr on Linux with JBoss

Written By

Liferay Support

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

This is an introductory guide to setting up Solr and then switching Liferay Portal's indexing method to Solr. Keep in mind that this is only one step in creating a cluster for use with Liferay Portal. For further instruction, see Installing Liferay Portal in a Clustered Environment.

Note: Want to see the same process using Tomcat? Read Installing SOLR on a Two-Node Cluster.

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, and a web administration interface. Solr allows the administrator to search structured data without needing to write any custom code.

Pros

  • Overall, has the best performance for clustering the indexes
  • Offloads the burden of indexing from the Liferay nodes
  • Centralized index repository
  • Solr has more configuration options that make customization easier

Cons

  • If the Solr box goes down, all nodes will have no index. However, there is a distributed/replication setup that gives Solr high availability. Learn More by reading Scaling Lucene and Solr.
  • Fairly involved configuration/setup

Resolution

In this bare-minimum guide, we'll set up three nodes:

  1. The Solr Node—The node that will do the indexing for the Liferay Portal nodes.
  2. Node 1—This node is running Liferay Portal and is clustered with node 1.
  3. Node 2—This node is running Liferay Portal and is clustered with node 2.

Setting up the Solr Node

  1. Download apache-solr-1.4.0.zip and unzip its contents.
  2. Create your $SOLR_HOME directory, for instance C:\Program Files\Solr.
    1. Navigate to apache-solr-1.4.0\example and copy the contents of the "solr" folder into your $SOLR_HOME.
  3. Copy the WAR file from the Solr folder you downloaded; it is located in $APACHE-SOLR/dist/apache-solr-${solr.version}.war into $TOMCAT_HOME/webapps where ${solr.version} represents Solr version number, i.e., 1.4.0.
    1. Rename the .war file to something easier, such as solr.war (the name will matter later).
  4. Add the following line to your $TOMCAT_AS_DIR/bin/catalina.bat.
    1. set JAVA_OPTS=%JAVA_OPTS% -Dsolr.solr.home="C:\Program Files\Solr"
  5. Run JBoss and visit the Solr Admin page to verify it runs correctly.

Setting up Node 1

  1. Start a Liferay Portal 6.1 EE GA2 bundle (using tomcat) and deploy solr-web-6.1.20.2-ee-ga2-20121226141007185.war
  2. Open the .war archive and edit the file solr-spring.xml, which is located in $SOLR_WAR\WEB-INF\classes\META-INF\
  3. Shutdown JBoss / Solr. Copy the Schema located in $SOLR_WAR\WEB-INF\conf\ and place it in the $SOLR_HOME/conf (you may have to create the conf directory) on your Solr box. Now you can go ahead and start JBoss / Solr.
  4. Deploy the Liferay Solr .war with the edited solr-spring.xml into Tomcat-Liferay bundle

Testing SOLR

  1. Create a Wiki.
  2. Navigate to the Solr admin webpage, and search for a term that is contained in your portal's contents.

Result

You should see assets with that term in your search results.

Did this article resolve your issue ?

Legacy Knowledge Base