jackluo923 commented on code in PR #13003: URL: https://github.com/apache/pinot/pull/13003#discussion_r1584152935
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/invertedindex/RealtimeLuceneTextIndex.java: ########## @@ -181,6 +192,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 ReflectiveOperationException("The specified lucene query parser class " + queryParserClassName Review Comment: NoSuchMethodException is an child of ReflectiveOperationException which makes sense here. Changed it to NoSuchMethodException. ########## pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java: ########## @@ -54,6 +54,11 @@ public class FieldConfig extends BaseJsonConfig { public static final String TEXT_INDEX_LUCENE_ANALYZER_CLASS = "luceneAnalyzerClass"; public static final String TEXT_INDEX_DEFAULT_LUCENE_ANALYZER_CLASS = "org.apache.lucene.analysis.standard.StandardAnalyzer"; + public static final String TEXT_INDEX_LUCENE_ANALYZER_CLASS_ARGS = "luceneAnalyzerClassArgs"; + public static final String TEXT_INDEX_LUCENE_ANALYZER_CLASS_ARG_TYPES = "luceneAnalyzerClassArgTypes"; + public static final String TEXT_INDEX_LUCENE_QUERY_PARSER_CLASS = "luceneQueryParserClass"; + public static final String TEXT_INDEX_DEFAULT_LUCENE_QUERY_PARSER_CLASS = + "org.apache.lucene.queryparser.classic.QueryParser"; Review Comment: Changed. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org