github-actions[bot] commented on code in PR #67918:
URL: https://github.com/apache/doris/pull/67918#discussion_r4092957169
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/InvertedIndexUtil.java:
##########
@@ -423,17 +488,27 @@ public static boolean isAnalyzerMatched(Map<String,
String> properties, String a
buildAnalyzerIdentity(properties));
}
+ String resolvedAnalyzer = resolveAnalyzerName(normalizedAnalyzer);
String preferredAnalyzer =
InvertedIndexProperties.getPreferredAnalyzer(properties);
if (!Strings.isNullOrEmpty(preferredAnalyzer)) {
- return normalizedAnalyzer.equalsIgnoreCase(preferredAnalyzer);
+ return
resolvedAnalyzer.equals(resolveAnalyzerName(preferredAnalyzer))
+ && (!INVERTED_INDEX_PARSER_IK.equals(resolvedAnalyzer)
+ || matchesBuiltinIkDefaults(properties));
}
String parser =
InvertedIndexProperties.getInvertedIndexParser(properties);
if (Strings.isNullOrEmpty(parser)) {
- return normalizedAnalyzer.equalsIgnoreCase("default")
- ||
normalizedAnalyzer.equalsIgnoreCase(INVERTED_INDEX_PARSER_NONE);
+ return resolvedAnalyzer.equals("default")
+ || resolvedAnalyzer.equals(INVERTED_INDEX_PARSER_NONE);
}
- return normalizedAnalyzer.equalsIgnoreCase(parser);
+ return resolvedAnalyzer.equals(parser.trim().toLowerCase(Locale.ROOT))
+ && (!INVERTED_INDEX_PARSER_IK.equals(resolvedAnalyzer)
Review Comment:
[P1] Preserve explicit IK queries on existing legacy indexes. Before this
change, a table whose only inverted index had `PROPERTIES("parser"="ik")`
satisfied `MATCH ... USING ANALYZER ik`; now this guard compares that
default-smart identity with the new `analyzer=ik` max-word default and returns
false, so `visitMatch` throws `No inverted index found for analyzer 'ik'`
immediately after the FE upgrade. This occurs in the supported BE-first
sequence because both the metadata and SQL predate the PR. Keep the canonical
max-word index preferred when it exists, but fall back to an unambiguous legacy
`parser=ik` index when it is the only match; the selected index's existing
mode/lowercase fields let the new BE bind its physical reader. Please add a
single-legacy-index upgrade test.
--
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]