Specify specific schema.xml for solr?

For my project we need to use a modified version of the solr A12CddCore schema.xml. is there any way to do this?

Hi @tiago-misty-delta,
From this Get A12 Documentation, there is a property config mgmtp.a12.dataservices.cdd.solr.collection.name which you can use to config the name of Solr core or collection.

where can I find these collections names and what they do?

The default schema names in DS are A12CddCore for CDD documents and A12Core for other documents.

If you want to use your custom schema, you can copy the whole Solr config directory from DS and paste it into your project resources as the following picture:


In my case, I copied the whole solr config from DS and renamed the schema name to my custom name: <schema name="ThienTest" version="1.5">. Remember that the directory should also be renamed to the custom schema name. Finally, I can now use the property config mgmtp.a12.dataservices.cdd.solr.collection.name=ThienTest

Hope it helps :slight_smile:

Hi @thien-nimble-cursor,
does this answer only apply for the embedded solr? When using solr in a docker container locally or in web environment we get an error in DS.

Hi @constantin-cool-needle,
You’re correct. My previous comment only applies to embedded Solr, which I failed to mention. Thank you for pointing that out.

For working with an external Solr server and its configuration, you can have a look at Redirecting…

Hey again @thien-nimble-cursor , is there a way to configure the solr init job to supply a custom schema.xml to the standalone solr running in its own pod? Or maybe use a predefined configuration that allows us to filter content with spaces in it I believe, @constantin-cool-needle knows best the desired behaviour of solr.

You can find the changes we are trying to achieve in the A12-15560 ticket. The problem was, that the documentation is very unclear on how to change the schema.xml inside a solr core when deploying to a web environment. On my local machine I have a docker bind volume set up so I can update the schemas. Would we have to change the docker image we use for deployment with updated solr cores inside?

Hey hey,

After clarifying with @constantin-cool-needle about the project’s deployment method, I suggest that you rebuild the Solr init image and supply it to the configuration in a12-infrastructure helm chart.

  1. Rebuild Solr init image
    Depending on the version you’re using and the mode of solr (standalone or solr cloud), you will need to update the image accordingly.
    Please have a look at the image source here on mgm Bitbucket by searching for repo name image_a12-solr. (mgm Internal only). Please choose the correct version before looking at it.
  2. Configure the solr init image in values.yaml file
solr:
  customInit:
    image:
      solrInit:
        registry: your-registry
        repository: your-repo-name
        tag: your-version

Please be aware that this way has already been deprecated since version 5.x and will be drop-supported in version 6.x. We provide a new way to download Solr config (and initialise during the start-up process of Solr.

Since OZG is using a custom chart of version 3.7.0, you can also update the chart itself to copy the modified schema.xml in the default docker image before running the init job. :wink: