Skip to content

Apache Lucene open-source search software

SOLR-8363: Fix luceneMatchVersion check and update in build scripts

Varun Thacker4a4f2a00e7be
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 702bc4d1012..0da761e42f4 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -126,13 +126,14 @@ def update_example_solrconfigs(new_version):
print(' updating example solrconfig.xml files')
matcher = re.compile('<luceneMatchVersion>')
- configset_dir = 'solr/server/solr/configsets'
- if not os.path.isdir(configset_dir):
- raise RuntimeError("Can't locate configset dir (layout change?) : " + configset_dir)
- for root,dirs,files in os.walk(configset_dir, onerror=onerror):
- for f in files:
- if f == 'solrconfig.xml':
- update_solrconfig(os.path.join(root, f), matcher, new_version)
+ paths = ['solr/server/solr/configsets', 'solr/example']
+ for path in paths:
+ if not os.path.isdir(path):
+ raise RuntimeError("Can't locate configset dir (layout change?) : " + path)
+ for root,dirs,files in os.walk(path, onerror=onerror):
+ for f in files:
+ if f == 'solrconfig.xml':
+ update_solrconfig(os.path.join(root, f), matcher, new_version)
def update_solrconfig(filename, matcher, new_version):
print(' %s...' % filename, end='', flush=True)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d1933a572f0..354004bb5ec 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -674,6 +674,9 @@ Other Changes
* SOLR-8330: Standardize and fix logger creation and usage so that they aren't shared
across source files.(Jason Gerlowski, Uwe Schindler, Anshum Gupta)
+* SOLR-8363: Fix check-example-lucene-match-version Ant task and addVersion.py script to
+ check and update luceneMatchVersion under solr/example/ configs as well logic. (Varun Thacker)
+
================== 5.3.1 ==================
Bug Fixes
diff --git a/solr/build.xml b/solr/build.xml
index fbed3cb75ec..473b9dcde1b 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -282,6 +282,7 @@
<target name="check-example-lucene-match-version">
<property name="configsets.dir" value="${server.dir}/solr/configsets"/>
+ <!-- validates all configset solrconfig files-->
<fail message="Some example solrconfig.xml files under ${configsets.dir} do not refer to the correct luceneMatchVersion: ${tests.luceneMatchVersion}">
<condition>
<resourcecount when="greater" count="0">
@@ -293,6 +294,18 @@
</resourcecount>
</condition>
</fail>
+ <!-- validates remaining example solrconfig files-->
+ <fail message="Some example solrconfig.xml files under ${example} do not refer to the correct luceneMatchVersion: ${tests.luceneMatchVersion}">
+ <condition>
+ <resourcecount when="greater" count="0">
+ <fileset dir="${example}" includes="**/solrconfig.xml">
+ <not>
+ <contains text="&lt;luceneMatchVersion&gt;${tests.luceneMatchVersion}&lt;" casesensitive="no"/>
+ </not>
+ </fileset>
+ </resourcecount>
+ </condition>
+ </fail>
<!-- Count the immediate sub-directories of the configsets dir to ensure all sub-dirs have a solrconfig.xml -->
<resourcecount property="count.subdirs">
<dirset dir="${configsets.dir}" includes="*"/>
diff --git a/solr/example/files/conf/solrconfig.xml b/solr/example/files/conf/solrconfig.xml
index e515c1b6210..4ba68941706 100644
--- a/solr/example/files/conf/solrconfig.xml
+++ b/solr/example/files/conf/solrconfig.xml
@@ -35,7 +35,7 @@
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
- <luceneMatchVersion>5.0.0</luceneMatchVersion>
+ <luceneMatchVersion>6.0.0</luceneMatchVersion>
<!-- <lib/> directives can be used to instruct Solr to load any Jars
identified and use them to resolve any "plugins" specified in