CrownChu commented on code in PR #8000:
URL: https://github.com/apache/paimon/pull/8000#discussion_r3471578691


##########
paimon-eslib/src/main/java/org/apache/paimon/eslib/index/ESIndexGlobalIndexerFactory.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.eslib.index;
+
+import org.apache.paimon.globalindex.GlobalIndexer;
+import org.apache.paimon.globalindex.GlobalIndexerFactory;
+import org.apache.paimon.options.Options;
+import org.apache.paimon.types.DataField;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Factory for creating ES multi-index global indexers. Supports vector 
(DiskBBQ/HNSW/Native),
+ * fulltext (BM25), and scalar fields.
+ */
+public class ESIndexGlobalIndexerFactory implements GlobalIndexerFactory {
+
+    public static final String IDENTIFIER = "es-index";
+
+    private static final String READ_SEARCH_THREADS_KEY =
+            "global-index.es-index.read-search-threads";
+    private static final int DEFAULT_READ_SEARCH_THREADS = -1;
+
+    private static volatile ExecutorService readSearchExecutor;
+    private static final Object LOCK = new Object();
+
+    @Override
+    public String identifier() {
+        return IDENTIFIER;
+    }
+
+    @Override
+    public boolean supportsFullTextSearch() {

Review Comment:
     Fixed in 9212f48b.
     FullTextScanImpl now matches a searched text column against both the 
primary indexFieldId and the extraFieldIds (via matchedTextColumnIds), in both 
the index-file filter and the per-column grouping. So a hybrid index (vector 
primary + text extra) now produces FullTextSearchSplits for the extra text 
column, and full-text search on it returns indexed results. Single-column 
indexes are unaffected (extraFieldIds == null → only the primary matches).
     The read path already reconstructs a multi-column indexer 
(FullTextReadImpl → factory.create(indexField, extraFields)), which requires a 
multi-column-capable backend; TestFullTextGlobalIndexerFactory was extended to 
support
     multi-column so the framework test covers it.
     Tests: 
FullTextSearchBuilderTest.testFullTextSearchServesTextColumnAsExtraField (extra 
text column is searchable) and 
testFullTextSearchSkipsIndexNotCoveringTextColumn (an index not covering the 
text column still returns empty).
     The previous testFullTextSearchRequiresTextColumnAsPrimaryField is 
replaced accordingly — the "primary only" contract is intentionally relaxed 
(discussed and agreed with the reviewer).



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

Reply via email to