You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/11/27 16:32:18 UTC

[GitHub] [lucene] uschindler commented on a change in pull request #482: Use the same analysis chain to StandardAnalyzer (a follow-up of #480)

uschindler commented on a change in pull request #482:
URL: https://github.com/apache/lucene/pull/482#discussion_r757797473



##########
File path: lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
##########
@@ -154,7 +158,12 @@ public Analyzer createAnalyzerFromClassName(String analyzerType) {
 
   private Analyzer defaultAnalyzer() {
     try {
-      return CustomAnalyzer.builder().withTokenizer("standard").build();
+      Map<String, String> params = new HashMap<>();
+      params.put("maxTokenLength", Integer.toString(StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH));
+      return CustomAnalyzer.builder()
+          .withTokenizer(StandardTokenizerFactory.NAME, params)

Review comment:
       You don't need a map. Customanalyzer takes a Varars of strings. We should use the code in the "official way" (see examples in Javadocs).
   
   ```
   return CustomAnalyzer.builder()
             .withTokenizer(StandardTokenizerFactory.NAME, params), "maxTokenLength", Integer.toString(StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH))...
   ```




-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org