Jackie-Jiang commented on code in PR #16147:
URL: https://github.com/apache/pinot/pull/16147#discussion_r2164624941


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/LuceneTextIndexUtils.java:
##########
@@ -33,10 +38,54 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
+/**
+ * Utility class for Lucene text index operations.
+ * Contains common methods for parsing options and creating query parsers.
+ */
 public class LuceneTextIndexUtils {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(LuceneTextIndexUtils.class);
 
+  // Parser option key
+  public static final String PARSER_OPTION = "parser";
+
+  // Parser values
+  public static final String PARSER_CLASSIC = "CLASSIC";
+  public static final String PARSER_STANDARD = "STANDARD";
+  public static final String PARSER_COMPLEX = "COMPLEX";
+
+  // Default operator values
+  public static final String DEFAULT_OPERATOR_AND = "AND";
+  public static final String DEFAULT_OPERATOR_OR = "OR";
+
+  // Boolean values
+  public static final String TRUE = "true";
+  public static final String FALSE = "false";
+
+  // Option keys - Lucene QueryParser configuration options
+  // These options are applied to Lucene QueryParser instances via reflection
+  // Documentation:
+  // 
https://lucene.apache.org/core/9_8_0/queryparser/org/apache/lucene/queryparser/classic/QueryParser.html
+  public static final String DEFAULT_OPERATOR_OPTION = "DefaultOperator";

Review Comment:
   (minor)
   1. Use lower case for the first character
   2. We can put these option keys under a subclass `OptionKey`, and remove 
`OPTION` from the name



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/invertedindex/MultiColumnRealtimeLuceneTextIndex.java:
##########
@@ -149,8 +150,65 @@ public MutableRoaringBitmap getDocIds(String searchQuery) {
     throw new UnsupportedOperationException("Multi-column text index requires 
column name to query!");
   }
 
+  @Override
+  public MutableRoaringBitmap getDocIds(String column, String searchQuery, 
@Nullable String optionsString) {
+    if (optionsString != null && !optionsString.trim().isEmpty()) {
+      LuceneTextIndexUtils.LuceneTextIndexOptions options = 
LuceneTextIndexUtils.createOptions(optionsString);
+      Map<String, String> optionsMap = options.getOptions();
+      if (!optionsMap.isEmpty()) {
+        return getDocIdsWithOptions(column, searchQuery, optionsMap);

Review Comment:
   Let's pass `LuceneTextIndexUtils.LuceneTextIndexOptions` all the way down to 
`LuceneTextIndexUtils.createQueryParserWithOptions()`



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

Reply via email to