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: [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]