[
https://issues.apache.org/jira/browse/SOLR-5247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13771005#comment-13771005
]
Chris F edited comment on SOLR-5247 at 9/18/13 6:08 PM:
--------------------------------------------------------
Thanks for the hint, Jack. I tried the approach with the properties in a second
file before but wasn't aware that I have to restart the servlet container to
make it work. A core reload wasn't enough.
So, with the custom parameters in a file called "solrcore.properties", the line
"properties=solrcore.properties" added to the core.properties file and after
restarting tomcat, it now works. Omitting any of these steps did not work for
me.
What's left is the problem with core creation. When creating a new core per
HTTP request like shown above, the property "foo" won't get persisted. It can
be used as long as the servlet container isn't restarted. After that, the
property is gone.
was (Author: n0v1):
Thanks for the hint, Jack. I tried the approach with the properties in a
second file before but wasn't aware that I have to restart the servlet
container to make it work. A core reload wasn't enough.
So, with the custom parameters in a file called "solrcore.properties", the line
"properties=solrcore.properties" added to the core.properties file and after
restarting tomcat, it now works. Omitting any step did not work for me.
What's left is the problem with core creation. When creating a new core per
HTTP request like shown above, the property "foo" won't get persisted. It can
be used as long as the servlet container isn't restarted. After that, the
property is gone.
> Support for custom per core properties missing with new-style solr.xml
> ----------------------------------------------------------------------
>
> Key: SOLR-5247
> URL: https://issues.apache.org/jira/browse/SOLR-5247
> Project: Solr
> Issue Type: Bug
> Components: multicore
> Affects Versions: 4.4
> Reporter: Chris F
> Priority: Critical
> Labels: 4.4, core.properties, discovery, new-style, property,
> solr.xml
>
> When using old-style solr.xml I can define custom properties per core like so:
> {code:xml}
> <cores adminPath="/admin/cores" defaultCoreName="core1">
> <core name="core1" instanceDir="core1" config="solrconfig.xml"
> schema="schema.xml">
> <property name="foo" value="bar" />
> </core>
> </cores>
> {code}
> I can then use the property "foo" in schema.xml or solrconfig.xml like this:
> {code:xml}
> <str name="foo">${foo}</str>
> {code}
> 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:
> {code}
> config=solrconfig.xml
> name=core1
> schema=schema.xml
> foo=bar
> {code}
> (I also tried property.foo=bar)
> With that, I get the following error when reloading the core:
> {code}
> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: No
> system property or default value specified for foo value:${foo}
> {code}
> 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:
> {code}
> http://localhost:8080/solr/admin/cores?action=CREATE&name=core2&instanceDir=core2&config=solrconfig.xml&schema=schema.xml&property.foo=bar&persist=true
> {code}
> the property "foo" will not appear in core.properties file.
> Possibly related to
> [SOLR-5208|https://issues.apache.org/jira/browse/SOLR-5208]?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]