Starting with ICM 7.10.16.6 the default search adapter included in the responsive starter store (component set a_responsive) changed.
This cookbook provides different recipes that describe the necessary changes to existing assemblies to use the different adapters that are provided as separate component sets.
For ICM 7.10.31.2+; Solr4 is not compatible anymore (see also Announcement - Solr 4 - ICM and Tomcat 9 Compatibility). An additional update of the Solr Cloud Connector (release 3.0.0+) is necessary.
An existing project uses the Solr search adapter that was included in the business component and this adapter should still be used.
com.intershop.business:ac_search_solr
to com.intershop.solr4:ac_search_solr
.Add a version properties file solr4.version to reference the used versions of the Solr4 component set and the used web archive containing the Solr4 server.
com.intershop.solr4:* = 29.0.2 com.intershop:solr4war = 1.0.2
Reference the created version file in your build.gradle of your component set by adding the following lines to the versionRecommendation
- provider
section.
versionRecommendation { provider { // solr4 + war dependencies properties('solr4', file('solr4.version')) {} ...
Include the Solr host type into the host type section within the build.gradle of your project assembly.
hostTypes { solr { include ( 'com.intershop:3rd_tomcat', 'com.intershop.infrastructure:runtime', 'com.intershop.infrastructure:tcm', 'com.intershop:solr4war', ) { transitive = false } includeLocal = true } ...
Add the deployment of the Solr4 configuration to the share
section by adding a line to include 'com.intershop.solr4:solr4_config
' into the share deployment.
hostTypes { share { include ( 'com.intershop.solr4:solr4_config', ...
Add the cartridges of the Solr4 component set to the cartridge list of the assembly by appending the cartridges to the existing cartridge list order.
cartridges { def solr4ProductionCartridges = [ 'ac_search_solr', 'ac_search_solr_bo', ] include('com.intershop.solr4:ac_search_solr', 'com.intershop.solr4:ac_search_solr_bo', in:[development, test, production]) ... order = listFromAssembly('com.intershop.assembly:commerce_management_b2c') + storefrontCartridges + initCartridges + developerCartridges + testCartridges + solr4ProductionCartridges }
To deploy the Solr host type and configurations, it is necessary to add the SolrDeployment plugin to your deployment. Add a deploy.gradle to your assembly:
apply plugin: com.intershop.deploy.intershop.IntershopPlugins apply plugin: com.intershop.deploy.intershop.SolrDeploymentPlugin
Disable the use of the inherited deploy.gradle to use the deploy.gradle of your assembly by removing 'deploy.gradle'
from the included artifacts:
assembly { inheritFrom('com.intershop.assembly:commerce_management_b2c') { - includeArtifacts type:['deploy-gradle', 'deploy-settings-gradle'] + includeArtifacts type:['deploy-settings-gradle'] }
Instead of referring to the Solr cartridge from com.intershop.business
, the new component Solr4 needs to be used in the build.gradle of cartridges that extend the Solr adapter.
//for using base classes from the adapter compile group: 'com.intershop.solr4', name: 'ac_search_solr' //to directly use solrj classes compile ("org.apache.solr:solr-solrj:4.8.1") { exclude module: 'log4j' exclude module: 'wstx-asl' }
The SolrCloud search adapter should be used in a project.
Add a version property file solrcloud.version to reference the used version of the SolrCloud component set.
com.intershop.solrcloud:* = 2.0.3
Reference the created version file in your build.gradle of your component set by adding the property file to the versionRecommendation
- provider
section.
versionRecommendation { provider { // solrcloud dependencies properties('solrcloud', file('solrcloud.version')) {} ...
Add the solrcloud_config
to the include
section of the share host type. Add the cartridges of the SolrCloud component set to the cartridge list of the assembly by appending the cartridges to the existing cartridge list order.
hostTypes { share { include ( 'com.intershop.solrcloud:solrcloud_config', ... cartridges { def solrcloudProductionCartridges = [ 'ac_solr_cloud', 'ac_solr_cloud_bo', ] include('com.intershop.solrcloud:ac_solr_cloud', 'com.intershop.solrcloud:ac_solr_cloud_bo', in:[development, test, production]) ... order = listFromAssembly('com.intershop.assembly:commerce_management_b2c') + storefrontCartridges + initCartridges + developerCartridges + testCartridges + solrcloudProductionCartridges }
To configure ICM for using the SolrCloud server, it is necessary to set the zooKeeperHostList
and clusterIndexPrefix
properties in your environment properties. To deploy these environment properties for your ICM server, create a deploy.gradle file in your project assembly directory with the following content:
apply plugin: com.intershop.deploy.intershop.IntershopPlugins apply plugin: com.intershop.deploy.intershop.SolrCloudDeploymentPlugin deployment { if (target.includeShare) { filters { overrideProperties('solrCloudProperties') { dir target.shareDirectory include 'system/config/cluster/appserver.properties' properties['solr.zooKeeperHostList'] = solrcloud.zooKeeperHostList properties['solr.clusterIndexPrefix'] = solrcloud.clusterIndexPrefix } } } }
Disable the use of the inherited deploy.gradle to use the deploy.gradle of your assembly.
assembly { inheritFrom('com.intershop.assembly:commerce_management_b2c') { - includeArtifacts type:['deploy-gradle', 'deploy-settings-gradle'] + includeArtifacts type:['deploy-settings-gradle'] }
Add the SolrCloud extension to your settings.gradle:
Note
In a CaaS context, the settings.gradle is dynamically created by the Operations team.
However, this step is still mandatory for local development.
solrcloud { zooKeeperHostList = 'localhost:9983' clusterIndexPrefix = 'demoICMserver' }
If it is an update from Solr4 to SolrCloud, remove all accesses to solr() sections.
In a project, the separate SolrCloud search adapter was already used and the steps from Recipe - Setup project using Solr Cloud were applied. This adapter should still be used.
Adapt the build.gradle to remove the sections that exclude dependencies and remove the Solr host type:
assembly { inheritFrom('com.intershop.assembly:commerce_management_b2x') { includeArtifacts type:['deploy-settings-gradle'] - excludeDependencies '3rd_solr_war_int', 'ac_search_solr', 'ac_search_solr_bo', 'ac_search_solr_test', 'ac_eureka_solr' } hostTypes { - solr { - exclude group:'com.intershop', module:'3rd_tomcat' - exclude group:'com.intershop.infrastructure', module:'runtime' - exclude group:'com.intershop.infrastructure', module:'tcm' - exclude group:'com.intershop.business', module:'3rd_solr_war_int' - }
Remove the replacement of previous Solr cartridges with the SolrCloud cartridges and just add the solrcloudProductionCartridges
to the cartridge list. Please also see Recipe: Use SolrCloud Adapter.
- def commerceCartridgesCartridges = listFromAssembly('com.intershop.assembly:commerce_management_b2x') - def solrCloudCartridges = commerceCartridgesCartridges.plus(commerceCartridgesCartridges.indexOf('ac_search_solr'), solrCloudProductionCartridges) - solrCloudCartridges = solrCloudCartridges.plus(solrCloudCartridges.indexOf('ac_search_solr_test'), solrCloudTestCartridges) - - order = solrCloudCartridges+ storefrontCartridges + initCartridges + developerCartridges + testCartridges + order = listFromAssembly('com.intershop.assembly:commerce_management_b2c') + storefrontCartridges + initCartridges + developerCartridges + testCartridges + solrcloudProductionCartridges
The project used the previously included search adapter cartridges and referenced the adapter cartridge(s) in project cartridges to e.g., extend functionality of these cartridges.
In case you use a custom cartridge that extends the Solr4 Adapter the dependencies must be changed from the group business
to solr4
:
- compile group: 'com.intershop.business', name: 'ac_search_solr' + compile group: 'com.intershop.solr4', name: 'ac_search_solr' + compile ("org.apache.solr:solr-solrj:4.8.1") + { + exclude module: 'log4j' + exclude module: 'wstx-asl' + }
The project must also be adapted as described in Recipe: Continue To Use Solr4 Adapter.
If the custom cartridge extends the Solr Cloud Adapter, the dependencies should look like:
- compile group: 'com.intershop.business', name: 'ac_search_solr' + compile group: 'com.intershop.solrcloud', name: 'ac_solr_cloud' + compile ("org.apache.solr:solr-solrj:8.5.1") + { + exclude module:'jcl-over-slf4j' + }