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


##########
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 do something like:
   
   ```java
   Stream.of(fieldType.getIndexAnalyzer(), fieldType.getQueryAnalyzer(), 
noIdeaHowToHandleThis.getMultiTermAnalyzer()).filter(a -> a instanceof 
TokenizerChain)
     .distinct().foreach(a -> 
informResourceLoaderAwareObjectsInChain((TokenizerChain) a);
   ```



##########
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) {

Review Comment:
   does this need to be protected? The inner method is private, so why is this 
one public? A method reference in lambdas does not need to be visible in any 
way.



-- 
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