You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sergei Goorov <go...@gmail.com> on 2010/04/14 08:32:31 UTC
Ignoring dataDir parameter in core creating process
When solr core is being created (in my case from solrj lib) the parameter
dataDir is ignored, the value from solrconfig.xml is used instead it.
Under debugger I find strange place in org.apache.solr.core.CoreContainer
(solr version 1.4):
public SolrCore create(CoreDescriptor dcore) throws
ParserConfigurationException, IOException, SAXException {
...
// my comment: here second parameter (which is null) is dataDir but
dcore has true dataDir value
SolrCore core = new SolrCore(dcore.getName(), null, config, schema,
dcore);
return core;
}
why dataDir is null in this SolrCore construction?
Or there is another place where dataDir should be properly set, this is in
SolrCore constructor:
public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema
schema, CoreDescriptor cd) {
...
if (dataDir == null){
dataDir = config.getDataDir();
if(dataDir == null) dataDir = cd.getDataDir();
}
dataDir = SolrResourceLoader.normalizeDir(dataDir);
...
}
My opinion is when core is creating dataDir should be firstly set from
CoreDescriptor parameter and only if its dataDir is null then retrieve
dataDir from global solr config file.
Is this bug or I insufficiently understand core creating behavior?
Many thanks,
Sergei
Re: Ignoring dataDir parameter in core creating process
Posted by Sergei Goorov <go...@gmail.com>.
This issue has been resolved by removing dataDir property from solrconfig.xml
On Wed, Apr 14, 2010 at 10:32 AM, Sergei Goorov <go...@gmail.com> wrote:
>
> When solr core is being created (in my case from solrj lib) the parameter dataDir is ignored, the value from solrconfig.xml is used instead it.
> Under debugger I find strange place in org.apache.solr.core.CoreContainer (solr version 1.4):
>
> public SolrCore create(CoreDescriptor dcore) throws ParserConfigurationException, IOException, SAXException {
> ...
> // my comment: here second parameter (which is null) is dataDir but dcore has true dataDir value
> SolrCore core = new SolrCore(dcore.getName(), null, config, schema, dcore);
> return core;
> }
>
> why dataDir is null in this SolrCore construction?
> Or there is another place where dataDir should be properly set, this is in SolrCore constructor:
>
> public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema schema, CoreDescriptor cd) {
> ...
> if (dataDir == null){
> dataDir = config.getDataDir();
> if(dataDir == null) dataDir = cd.getDataDir();
> }
>
> dataDir = SolrResourceLoader.normalizeDir(dataDir);
> ...
> }
>
> My opinion is when core is creating dataDir should be firstly set from CoreDescriptor parameter and only if its dataDir is null then retrieve dataDir from global solr config file.
> Is this bug or I insufficiently understand core creating behavior?
>
> Many thanks,
> Sergei