SOLR-883 -- Implicit properties are not set for Cores created through CoreAdmin

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@738378 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-01-28 06:30:58 +00:00
parent 100d85d8a6
commit 61f9aab471
4 changed files with 9 additions and 3 deletions

View File

@ -221,6 +221,8 @@ Bug Fixes
25. SOLR-978: Old files are not removed from slaves after replication (Jaco, Noble Paul, shalin)
26. SOLR-883: Implicit properties are not set for Cores created through CoreAdmin (Noble Paul via shalin)
Other Changes
----------------------

View File

@ -202,7 +202,6 @@ public class CoreContainer
List<String> aliases = StrUtils.splitSmart(names,',');
String name = aliases.get(0);
CoreDescriptor p = new CoreDescriptor(this, name, DOMUtil.getAttr(node, "instanceDir", null));
p.setCoreProperties(readProperties(cfg, node));
// deal with optional settings
String opt = DOMUtil.getAttr(node, "config", null);
@ -214,6 +213,8 @@ public class CoreContainer
p.setSchemaName(opt);
}
p.setCoreProperties(readProperties(cfg, node));
SolrCore core = create(p);
for (int a=1; a<aliases.size(); a++) {

View File

@ -129,11 +129,12 @@ public class CoreDescriptor implements Cloneable {
*
* @param coreProperties
*/
void setCoreProperties(Properties coreProperties) {
public void setCoreProperties(Properties coreProperties) {
if (this.coreProperties == null) {
Properties p = initImplicitProperties();
this.coreProperties = new Properties(p);
this.coreProperties.putAll(coreProperties);
if(coreProperties != null)
this.coreProperties.putAll(coreProperties);
}
}
}

View File

@ -103,6 +103,8 @@ public abstract class CoreAdminHandler extends RequestHandlerBase
if (opts != null)
dcore.setSchemaName(opts);
dcore.setCoreProperties(null);
SolrCore core = cores.create(dcore);
cores.register(name, core,false);
rsp.add("core", core.getName());