CrownChu commented on code in PR #8000: URL: https://github.com/apache/paimon/pull/8000#discussion_r3528740898
########## 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() { + // The ES index is a hybrid backend: a FULLTEXT-typed column (whether it is the primary + // index field or an extra field of a multi-column index) is served by Lucene full-text + // search. Without this override FullTextScanImpl filters out every es-index file and the + // planner full-text path returns nothing. + return true; Review Comment: Thanks — fixed at the root on the write side rather than in the scan. String columns now default to FULLTEXT (with a .keyword sub-field) instead of KEYWORD (commit c417d6d677), so a text column carried as an extra field of a hybrid index is genuinely full-text-searchable and the planning/reading paths agree — no KEYWORD-vs-FULLTEXT mismatch. Exact predicates (=, IN, ranges, prefix) keep exact semantics by routing to the <field>.keyword sub-field; type=keyword opts a column out of full-text. Let me know if you'd still prefer capability-aware coverage as defense-in-depth for the explicit type=keyword case. -- 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]
