From 51faf50db4bf7674e17fbabdc6be21d47164d03f Mon Sep 17 00:00:00 2001 From: Peng Huo Date: Wed, 26 Jun 2024 09:27:47 -0700 Subject: [PATCH] Fix IT Signed-off-by: Peng Huo --- .../flint/core/storage/FlintOpenSearchClient.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java b/flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java index 7d56e3011..2e5700c49 100644 --- a/flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java +++ b/flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java @@ -60,7 +60,7 @@ public class FlintOpenSearchClient implements FlintClient { * excluding '*' because it's reserved for pattern matching. */ private final static Set INVALID_INDEX_NAME_CHARS = - Set.of(' ', ':', '"', '+', '/', '\\', '|', '?', '#', '>', '<'); + Set.of(' ', ',', ':', '"', '+', '/', '\\', '|', '?', '#', '>', '<'); private final FlintOptions options; @@ -167,7 +167,9 @@ public void deleteIndex(String indexName) { /** * Create {@link FlintReader}. * - * @param indexName index name. + * FIXME: should indexName limit to single index? revisit this when add index partition. + * + * @param indexName index name. index name could be single index name, comma separate index. * @param query DSL query. DSL query is null means match_all. * @return {@link FlintReader}. */ @@ -183,7 +185,8 @@ public FlintReader createReader(String indexName, String query) { queryBuilder = AbstractQueryBuilder.parseInnerQueryBuilder(parser); } return new OpenSearchScrollReader(createClient(), - sanitizeIndexName(indexName), + String.join(",", + Arrays.stream(indexName.split(",")).map(this::sanitizeIndexName).toArray(String[]::new)), new SearchSourceBuilder().query(queryBuilder), options); } catch (IOException e) {