bigGuy
bigGuy

Reputation: 1744

Where to define properties that are common for all Solr cores?

I use Solr 5.3.

I have few cores. At the moment, custom properties for each core are defined in my_core_x/core.properties file. However, all custom properties are the same for all cores. So, I have multiple identical core.properties files.

Is it possible to define properties somewhere else, in one place only?

EDIT: I want to use these custom properties in solrconfig.xml like this:

${my.custom.property}

Upvotes: 1

Views: 1319

Answers (1)

MatsLindh
MatsLindh

Reputation: 52892

You can add custom properties through the regular -D syntax when starting Solr / the JVM.

From Configuring solrconfig.xml:

Any JVM System properties, usually specified using the -D flag when starting the JVM, can be used as variables in any XML configuration file in Solr.

For example, in the sample solrconfig.xml files, you will see this value which defines the locking type to use: <lockType>${solr.lock.type:native}</lockType>

Which means the lock type defaults to "native" but when starting Solr, you could override this using a JVM system property by launching the Solr it with:

bin/solr start -Dsolr.lock.type=none

Upvotes: 2

Related Questions