Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5247

Support for custom per core properties missing with new-style solr.xml

    XMLWordPrintableJSON

Details

    Description

      This part has been solved. See comments

      When using old-style solr.xml I can define custom properties per core like so:

      <cores adminPath="/admin/cores" defaultCoreName="core1">
        <core name="core1" instanceDir="core1" config="solrconfig.xml" schema="schema.xml">
          <property name="foo" value="bar" />
        </core>
      </cores>
      

      I can then use the property "foo" in schema.xml or solrconfig.xml like this:

      <str name="foo">${foo}</str>
      

      After switching to the new-style solr.xml with separate core.properties files per core this does not work anymore.

      I guess the corresponding core.properties file should look like this:

      config=solrconfig.xml
      name=core1
      schema=schema.xml
      foo=bar
      

      (I also tried property.foo=bar)

      With that, I get the following error when reloading the core:

      org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: No system property or default value specified for foo value:${foo}
      

      I can successfully reload the core if I use ${foo:undefined} but the value of "foo" will always be "undefined" then.

      When trying to create a new core with an url like this:

      http://localhost:8080/solr/admin/cores?action=CREATE&name=core2&instanceDir=core2&config=solrconfig.xml&schema=schema.xml&property.foo=bar&persist=true
      

      the property "foo" will not appear in core.properties. However, I can use it in schema.xml. But only until restarting the servlet container. After that, the property is lost.

      Possibly related to SOLR-5208?

      Attachments

        Activity

          People

            erickerickson Erick Erickson
            n0v1 Chris F
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: