Solr server standalone mode
We know that Solr is used to make faster search and its easily configurable in Hybris.
Please read solr-overview-in-hybris article for basic details on the same
We know that Hybris was supporting Solr server in 2 ways
1) embedded
2) standalone
But from 6.x onwards, Hybris supports only standalone Solr server
There are 3 instances of Solr server configured by Hybris automatically.
1) Default solr server instance
2) Standalone solr server instance
3) Cloud solr server instance
Let’s see how to configure Solr server in standalone mode
Step 1
Add below extension in localextensions.xml
- <extension name=”solrserver”/>
<extension name=”solrserver”/>
solrserver extension is provided by hybris which includes a standalone Solr server which can be automatically
configured, started and stopped together with the platform.
By default Solr server is configured as below in the project.properties of solrserver extension
- solrserver.instances.default.autostart=true
- solrserver.instances.standalone.autostart=false
- solrserver.instances.cloud.autostart=false
solrserver.instances.default.autostart=true solrserver.instances.standalone.autostart=false solrserver.instances.cloud.autostart=false
if autostart = false, we need to explicitly start and stop the Solr server
if autostart = true, Solr server will be started and stopped together with the Hybris server
Another important attribute to set is mode
It has 2 values
1) Standalone
2) Cloud
We need to set it accordingly
For standalone mode it should be set as below
- solrserver.instances.standalone.mode=standalone
solrserver.instances.standalone.mode=standalone
Step 2
Do ant all and start Hybris server
Because autostart is enabled for the default Solr server instance, the Solr server will be started and stopped together with the platform
Step 3
Start the solr server
As explained above, if autostart = true then solr server will be started automatically when Hybris server starts
If autostart = false then we need to start it explicitly
To start the solr server explicitly, Open command prompt and switch to below path
hybris/bin/ext-commerce/solrserver/resources/solr/bin
Use the following command
solr.cmd start -p 8983
Step 4
Stopping the Solr server
As explained above, if autostart = true then solr server will be stopped automatically when Hybris server stops
If autostart = false then we need to stop it explicitly
To stop the solr server explicitly, Open command prompt and switch to below path
hybris/bin/ext-commerce/solrserver/resources/solr/bin
Use the following command
solr.cmd stop -p 8983