Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-18197: NestPathField: tolerate legacy maxCharsForDocValues arg (#4964)

David Smiley70c1a28995dd
diff --git a/solr/core/src/java/org/apache/solr/schema/NestPathField.java b/solr/core/src/java/org/apache/solr/schema/NestPathField.java
index bac7fa74997..082a9dd13d5 100644
--- a/solr/core/src/java/org/apache/solr/schema/NestPathField.java
+++ b/solr/core/src/java/org/apache/solr/schema/NestPathField.java
@@ -49,6 +49,8 @@ public class NestPathField extends StrField {
args.putIfAbsent("docValues", "true"); // flip a default; necessary for old schemas
args.putIfAbsent("multiValued", "false"); // flip a default; necessary for old schemas
args.putIfAbsent("uninvertible", "false"); // flip a default; necessary for old schemas
+ // Schema API persisted this when NestPathField extended SortableTextField (Solr <= 9.10)
+ args.remove("maxCharsForDocValues");
super.setArgs(schema, args);
// Doesn't support these flags; perhaps others too.
// note: we could support STORED if truly useful but why bother given docValues.
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-nest.xml b/solr/core/src/test-files/solr/collection1/conf/schema-nest.xml
index 86775a6c61c..94573d662cb 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-nest.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-nest.xml
@@ -41,7 +41,8 @@
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
- <fieldType name="_nest_path_" class="solr.NestPathField" />
+ <!-- Legacy attributes: as persisted by the Schema API in Solr 9.10 and earlier -->
+ <fieldType name="_nest_path_" class="solr.NestPathField" omitTermFreqAndPositions="true" omitNorms="true" maxCharsForDocValues="-1" multiValued="false" stored="false"/>
<!-- Point Fields -->
<fieldType name="int" class="solr.IntPointField"/>