From bb82974c6aaef4df3737301ad9586049c0c8c736 Mon Sep 17 00:00:00 2001 From: zane-neo Date: Mon, 27 May 2024 16:11:26 +0800 Subject: [PATCH] rebase latest code Signed-off-by: zane-neo --- .../neuralsearch/processor/InferenceProcessorTestCase.java | 2 ++ .../neuralsearch/processor/TextEmbeddingProcessorTests.java | 3 +-- .../search/query/HybridQueryPhaseSearcherTests.java | 1 - .../neuralsearch/util/ProcessorDocumentUtilsTests.java | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/opensearch/neuralsearch/processor/InferenceProcessorTestCase.java b/src/test/java/org/opensearch/neuralsearch/processor/InferenceProcessorTestCase.java index 05a327b82..866a2ab29 100644 --- a/src/test/java/org/opensearch/neuralsearch/processor/InferenceProcessorTestCase.java +++ b/src/test/java/org/opensearch/neuralsearch/processor/InferenceProcessorTestCase.java @@ -5,6 +5,7 @@ package org.opensearch.neuralsearch.processor; import com.google.common.collect.ImmutableList; +import org.opensearch.index.mapper.IndexFieldMapper; import org.opensearch.ingest.IngestDocument; import org.opensearch.ingest.IngestDocumentWrapper; import org.opensearch.test.OpenSearchTestCase; @@ -21,6 +22,7 @@ protected List createIngestDocumentWrappers(int count) { for (int i = 0; i < count; ++i) { Map sourceAndMetadata = new HashMap<>(); sourceAndMetadata.put("key1", "value1"); + sourceAndMetadata.put(IndexFieldMapper.NAME, "my_index"); wrapperList.add(new IngestDocumentWrapper(i, new IngestDocument(sourceAndMetadata, new HashMap<>()), null)); } return wrapperList; diff --git a/src/test/java/org/opensearch/neuralsearch/processor/TextEmbeddingProcessorTests.java b/src/test/java/org/opensearch/neuralsearch/processor/TextEmbeddingProcessorTests.java index aaf4f33f7..bff578ad7 100644 --- a/src/test/java/org/opensearch/neuralsearch/processor/TextEmbeddingProcessorTests.java +++ b/src/test/java/org/opensearch/neuralsearch/processor/TextEmbeddingProcessorTests.java @@ -538,8 +538,7 @@ public void test_batchExecute_successful() { public void test_batchExecute_exception() { final int docCount = 5; List ingestDocumentWrappers = createIngestDocumentWrappers(docCount); - Map config = createPlainStringConfiguration(); - TextEmbeddingProcessor processor = createInstanceWithNestedMapConfiguration(config); + TextEmbeddingProcessor processor = createInstanceWithLevel1MapConfig(); doAnswer(invocation -> { ActionListener>> listener = invocation.getArgument(2); listener.onFailure(new RuntimeException()); diff --git a/src/test/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcherTests.java b/src/test/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcherTests.java index de0ea5616..ed637f2a0 100644 --- a/src/test/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcherTests.java +++ b/src/test/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcherTests.java @@ -15,7 +15,6 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.cluster.metadata.IndexMetadata.TRANSLOG_METADATA_KEY; import static org.opensearch.index.mapper.SeqNoFieldMapper.PRIMARY_TERM_NAME; import static org.opensearch.index.remote.RemoteStoreEnums.PathType.HASHED_PREFIX; import static org.opensearch.neuralsearch.search.util.HybridSearchResultFormatUtil.isHybridQueryStartStopElement; diff --git a/src/test/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtilsTests.java b/src/test/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtilsTests.java index 7284b88b2..068edcf2f 100644 --- a/src/test/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtilsTests.java +++ b/src/test/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtilsTests.java @@ -60,7 +60,6 @@ public void test_with_different_configurations() throws URISyntaxException, IOEx "field_map", source, fieldMap, - 1, "test_index", clusterService, environment,