cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Solr not properly extensible through configsets

Former Member
856

Simple problem really, but it's actually not possible to do this properly in hybris after SOLR was moved from embedded to standalone/cloud/whatnot (there used to be a buildcallback after_createSolrInstance which is no longer used - should be deprecated).

The way SOLR currently gets its configuration is, before startup, if the {hybris_config_dir}/solr/instances/{instanceName} directory doesn't exist, it will fetch all config (and configsets) from {hybris_bin_dir}/ext-commerce/solrserver/resources/solr/server/solr.

Put simply, I'm looking to modify my schema.xml and add a couple of fields. Hybris recommends simply duplicating the existing default configset with a new name, and adding it to the configsets folder.

My initial approach to this, was to add a bit of gradle logic (we use custom installer scripts for building across environments) that would copy my configset from somewhere in my repo to {hybris_config_dir}/solr/instances/{instanceName}/configsets. This won't cut it though, as SOLR now won't get all it's other configuration copied over before startup and thus breaks.

The solution is simple, but fundamentally wrong. I can simply take ownership of the whole {hybris_bin_dir}/ext-commerce/solrserver/resources/solr/server/solr folder, adding it to my repo, and copying it to the right place as part of my build. This is a lot of unnecessary stuff to take ownership of though, and I'm wondering if anyone has a better solution?

If any actual Hybris guys are reading this, I'd encourage that you add a configuration for where it looks for configsets:

de.hybris.platform.solrserver.impl.DefaultSolrServerService.createInstanceConfigDirectory Instead of final Path sourceConfigSetsDirectory = Paths.get(extensionSolrServerPath, "/resources/solr", "/server/solr/configsets");

Accepted Solutions (0)

Answers (0)