There are two ways to install the Liferay Connector to Solr 7:
Navigate to Liferay Marketplace and download the app that corresponds to your portal:
Liferay Portal CE: Liferay CE Connector to Solr 7
Liferay DXP: Liferay Connector to Solr 7
Once the app LPKG is downloaded, copy it to
In your running portal instance, navigate to Control Panel → Apps → Store. Sign in using your credentials, search for Solr Search Engine, and purchase (it’s free) the Liferay Connector to Solr 7 entry.
This guide leads you through installing and configuring Solr. As you proceed, remember these terms:
Solr Home: The center of the Solr system (pun intended). This directory is
Liferay Home: The root folder of your Liferay Portal installation. It contains the
license folders, among others.
There are two installation steps:
Installing and configuring Solr 7.
Installing and configuring the Solr 7 connector for Liferay Portal.
Before configuring Liferay Portal for Solr, install and set up Solr.
Installing and Configuring Solr 7
To install and properly configure Solr for Liferay Portal:
Download Solr and unzip it.
solr-[version]/server/solr. This is Solr Home.
Create a new folder called
liferayfolder, create two new folders:
Copy the contents of
Open the Liferay Connector to Solr 7’s LPKG file with an archive manager.
com.liferay.portal.search.solr7.impl.jarfile, and extract
This replaces the current
schema.xmlfiles with ones that tell Solr how to index data coming from Liferay Portal.
Solr_Home/liferayand add this configuration:
config=solrconfig.xml dataDir=data name=liferay schema=schema.xml
Solr_Home/liferayfolder now has this structure:
liferay ├── conf │ ├── lang │ │ ├── contractions_ca.txt │ │ ├── ....txt │ ├── managed-schema │ ├── params.json │ ├── protwords.txt │ ├── schema.xml │ ├── solrconfig.xml │ ├── stopwords.txt │ └── synonyms.txt ├── core.properties └── data
Start the Solr server by entering
./bin/solr start -f
from the top-level folder of your Solr installation (
The Solr server listens on port
8983by default. Navigate to
http://localhost:8983/solr/#/~cores(assuming you’re testing locally with
localhostas your host), and confirm that the
liferaycore is available.
Solr is now installed. Next install and configure the Solr connector.
Installing and Configuring the Liferay Solr Adapter
Since Elasticsearch is the default search engine, the Elasticsearch connector is already installed and running. You must stop it before configuring the Solr connector.
Stop the Elasticsearch connector bundle using the App Manager, the Felix Gogo shell, or the bundle blacklist. If you’re a Liferay DXP customer, use the blacklist feature as described below. The App Manager and Gogo shell rely on the
osgi/state folder to “remember” the state of the bundle. If you delete this folder (recommended during patching) the Elasticsearch connector is reinstalled and started automatically.
Navigate to Control Panel → Apps → App Manager.
Once in the App Manager, search for elasticsearch. Find the Liferay Connector to Elasticsearch 6 module and click the Actions (()) button. Choose the Deactivate option. This leaves the bundle installed, but stops it in the OSGi runtime.
Alternatively, use the Felix Gogo shell to stop the Elasticsearch connector. Enter
You’ll see two active bundles for the Liferay Connector to Elasticsearch 6: an API and an IMPL bundle.
ID|State |Level|Name 476|Active | 10|Liferay CE Connector to Elasticsearch 6 - API (2.0.0) 478|Active | 10|Liferay Portal Search Elasticsearch 6 API (2.0.6) 706|Active | 10|Liferay CE Connector to Elasticsearch 6 - Impl (2.0.0) 707|Active | 10|Liferay Portal Search Elasticsearch 6 Implementation (2.0.5)
Stop the API bundle by entering
stop [bundle ID]
In the example above, the
[bundle ID] is
Install and configure the Solr connector:
Start Liferay Portal, then deploy the Solr connector by copying the LPKG you downloaded to
You’ll see a
STARTEDmessage in your Liferay Portal log once the Solr connector is installed. Here’s what the log message looks like:
2018-11-06 19:59:49.396 INFO [pipe-start 943 944][BundleStartStopLogger:39] STARTED com.liferay.portal.search.solr7.api_1.0.0  2018-11-06 19:59:49.490 INFO [pipe-start 943 944][BundleStartStopLogger:39] STARTED com.liferay.portal.search.solr7.impl_1.0.0 
To re-index against Solr, navigate to Control Panel → Configuration → Search, and click Execute next to the Reindex all search indexes option.
In production deployments, specify your edits to the Solr connector’s default configurations using a configuration file deployed to the
Liferay_Home/osgi/configs folder. Name the file
During testing and development, use the Solr 7 System Settings entry Control Panel → Configuration → System Settings for editing the default configurations.
The next article covers clustering Solr with SolrCloud.