How do override files work?

Preface

Quite a few of the components used in Locator, uses overrides to apply custom configurations to a Locator installation. The reason overrides files are used, is to ensure that during upgrades of Locator, any custom configuration changes that have been made are applied during the upgrade.

How does it work?

Any override is composed of three files

  • file_base.xml
  • file_overrides.xml
  • file.xml

Let us use a real life example for clarification, namely the file schema.xml which is used by the SOLR Index Service. This has these three files:

  • schema_base.xml
  • schema_overrides.xml
  • schema.xml

The schema_base.xml file contains the base configuration for the SOLR schema, schema_overrides.xml contains the overrides to be applied (if any) and schema.xml is the file that is loaded by the SOLR Index Service.

All override files are XML files, and all overrides must be done by using XPATH queries. You can read more about XPATH here.

According to your XPATH quires, the command line tool Via.SolrUpdate.exe (explained below) will load the base XML file, do its operations based on the content of the overrides file and apply the output to the final output file which in this case is schema.xml.

Real life example

Say we wanted to add a field name called lingo_kmit_iban to our schema. We would then add the follow XPATH query to our schema_overrides.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<diff>
	<add sel="/schema/fields">
		<field name="lingo_kmit_iban" type="string" indexed="true" stored="false" multiValued="true" docValues="true" />
	</add>
</diff>

To apply this change, we need to use the command line tool Via.SolrUpdate.exe found in the Tools folder in %ProgramFiles%. So start a CMD session with administrative privileges, and CD into the folder that holds your schema* files, then issue the following command:

"c:\Program Files\ayfie\Locator\Tools\Via.SolrUpdate.exe" APPLY c:\ProgramData\ayfie\Locator\Solr\configsets\ViaWorksCloud\conf\schema_base.xml c:\ProgramData\ayfie\Locator\Solr\configsets\ViaWorksCloud\conf\schema_overrides.xml c:\ProgramData\ayfie\Locator\Solr\configsets\ViaWorksCloud\conf\schema.xml

If the XPATH is valid, your overrides should now have been applied.

ayfie