uschindler commented on code in PR #2175:
URL: https://github.com/apache/solr/pull/2175#discussion_r1442076218


##########
solr/core/src/java/org/apache/solr/schema/IndexSchema.java:
##########
@@ -1991,6 +1997,37 @@ public IndexSchema deleteCopyFields(Map<String, 
Collection<String>> copyFields)
     throw new SolrException(ErrorCode.SERVER_ERROR, msg);
   }
 
+  /** Informs analyzers used by a fieldType. */
+  protected void informResourceLoaderAwareObjectsForFieldType(FieldType 
fieldType) {
+    // must inform any sub-components used in the
+    // tokenizer chain if they are ResourceLoaderAware
+    if (!fieldType.supportsAnalyzers()) return;
+
+    Analyzer indexAnalyzer = fieldType.getIndexAnalyzer();

Review Comment:
   maybe this one works:
   
   ```java
   var stream = Stream.of(fieldType.getIndexAnalyzer(), 
fieldType.getQueryAnalyzer());
   if (fieldType instanceof TextField) {
     stream = Stream.concat(stream, Stream.of(((TextField) 
fieldType).getMultiTermAnalyzer());
   }
   stream.filter(a -> a instanceof TokenizerChain)
     .distinct().foreach(a -> 
informResourceLoaderAwareObjectsInChain((TokenizerChain) a);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to