I'm running into an issue where variable substitution is not working properly when loading data config from an XML file. I have an entity element with attribute url="${solr.core.instanceDir}/workDir/claimcontact.xml". When running full-import, I get this error:
I'm running into an issue where variable substitution is not working properly when loading data config from an XML file. I have an entity element with attribute
url="${solr.core.instanceDir}/workDir/claimcontact.xml"
. When running full-import, I get this error:As you can see, the
solr.core.instanceDir
variable is not being substituted correctly. I believe the issue is with this bit of code in DocBuilder: https://github.com/SearchScale/dataimporthandler/blob/branch_9x/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java#L116-L120In Solr 8, a change was made to get the properties from CoreDescriptor substitutableProperties: https://github.com/apache/lucene-solr/commit/17ae79b0905b2bf8635c1b260b30807cae2f5463#diff-9eadac54fe1ace540cb05b6711791be03a9289a7d6f16615fb4efa4ee31641f9
CoreDescriptor substitutableProperties has
solr.core.instanceDir
as a property: https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java#L269However, note that in the Solr 9 DocBuilder change in this repo, the Solr 8 "before" code did not have this change: https://github.com/SearchScale/dataimporthandler/commit/ec730d5ed48822001d7281619876a9a631e0f25a#diff-88595e01694c11981cecf4b71fdc54969870ff49737208856685388eb3bb0ee5
Should this be changed to
new VariableResolver(dataImporter.getCore().getCoreDescriptor().getSubstitutableProperties());
?