jackluo923 commented on code in PR #13003:
URL: https://github.com/apache/pinot/pull/13003#discussion_r1697971089
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/invertedindex/RealtimeLuceneTextIndex.java:
##########
@@ -181,6 +194,27 @@ private MutableRoaringBitmap getPinotDocIds(IndexSearcher
indexSearcher, Mutable
return actualDocIDs;
}
+ private Constructor<QueryParserBase>
getQueryParserWithStringAndAnalyzerTypeConstructor(String queryParserClassName)
+ throws ReflectiveOperationException {
+ // Fail-fast if the query parser is specified class is not QueryParseBase
class
+ final Class<?> queryParserClass = Class.forName(queryParserClassName);
+ if (!QueryParserBase.class.isAssignableFrom(queryParserClass)) {
+ throw new ReflectiveOperationException("The specified lucene query
parser class " + queryParserClassName
+ + " is not assignable from " + QueryParserBase.class.getName());
+ }
+ // Fail-fast if the query parser does not have the required constructor
used by this class
+ try {
+ queryParserClass.getConstructor(String.class, Analyzer.class);
+ } catch (NoSuchMethodException ex) {
+ throw new NoSuchMethodException("The specified lucene query parser class
" + queryParserClassName
+ + " is not assignable from does not have the required
constructor method with parameter type "
Review Comment:
fixed.
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/store/TextIndexUtils.java:
##########
@@ -108,10 +113,140 @@ private static List<String> parseEntryAsString(@Nullable
Map<String, String> col
.collect(Collectors.toList());
}
- public static Analyzer getAnalyzerFromClassName(String luceneAnalyzerClass)
- throws ReflectiveOperationException {
- // Support instantiation with default constructor for now unless customized
- return (Analyzer)
Class.forName(luceneAnalyzerClass).getConstructor().newInstance();
+ public static Analyzer getAnalyzer(TextIndexConfig config) throws
ReflectiveOperationException {
Review Comment:
added.
--
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]