diff --git a/src/main/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactory.java b/src/main/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactory.java index 953b91766..e551909aa 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactory.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactory.java @@ -13,11 +13,11 @@ import org.opensearch.ingest.ConfigurationUtils; import org.opensearch.neuralsearch.ml.MLCommonsClientAccessor; -import org.opensearch.neuralsearch.processor.rerank.ContextSourceFetcher; -import org.opensearch.neuralsearch.processor.rerank.DocumentContextSourceFetcher; import org.opensearch.neuralsearch.processor.rerank.MLOpenSearchRerankProcessor; -import org.opensearch.neuralsearch.processor.rerank.QueryContextSourceFetcher; import org.opensearch.neuralsearch.processor.rerank.RerankType; +import org.opensearch.neuralsearch.processor.rerank.context.ContextSourceFetcher; +import org.opensearch.neuralsearch.processor.rerank.context.DocumentContextSourceFetcher; +import org.opensearch.neuralsearch.processor.rerank.context.QueryContextSourceFetcher; import org.opensearch.search.pipeline.Processor; import org.opensearch.search.pipeline.SearchResponseProcessor; diff --git a/src/main/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessor.java b/src/main/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessor.java index c94ddf6ca..db6f43f95 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessor.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessor.java @@ -13,6 +13,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.neuralsearch.ml.MLCommonsClientAccessor; import org.opensearch.neuralsearch.processor.factory.RerankProcessorFactory; +import org.opensearch.neuralsearch.processor.rerank.context.ContextSourceFetcher; +import org.opensearch.neuralsearch.processor.rerank.context.DocumentContextSourceFetcher; +import org.opensearch.neuralsearch.processor.rerank.context.QueryContextSourceFetcher; /** * Rescoring Rerank Processor that uses a TextSimilarity model in ml-commons to rescore diff --git a/src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java b/src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java index 6104990ab..8b75068f6 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java @@ -12,6 +12,7 @@ import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchResponse; import org.opensearch.core.action.ActionListener; +import org.opensearch.neuralsearch.processor.rerank.context.ContextSourceFetcher; import org.opensearch.search.pipeline.PipelineProcessingContext; import org.opensearch.search.pipeline.SearchResponseProcessor; diff --git a/src/main/java/org/opensearch/neuralsearch/processor/rerank/RescoringRerankProcessor.java b/src/main/java/org/opensearch/neuralsearch/processor/rerank/RescoringRerankProcessor.java index 43efb795d..41494c631 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/rerank/RescoringRerankProcessor.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/rerank/RescoringRerankProcessor.java @@ -13,6 +13,7 @@ import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.SearchResponseSections; import org.opensearch.core.action.ActionListener; +import org.opensearch.neuralsearch.processor.rerank.context.ContextSourceFetcher; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.profile.SearchProfileShardResults; diff --git a/src/main/java/org/opensearch/neuralsearch/processor/rerank/ContextSourceFetcher.java b/src/main/java/org/opensearch/neuralsearch/processor/rerank/context/ContextSourceFetcher.java similarity index 94% rename from src/main/java/org/opensearch/neuralsearch/processor/rerank/ContextSourceFetcher.java rename to src/main/java/org/opensearch/neuralsearch/processor/rerank/context/ContextSourceFetcher.java index d8a576937..6a98b6561 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/rerank/ContextSourceFetcher.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/rerank/context/ContextSourceFetcher.java @@ -2,7 +2,7 @@ * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ -package org.opensearch.neuralsearch.processor.rerank; +package org.opensearch.neuralsearch.processor.rerank.context; import java.util.Map; diff --git a/src/main/java/org/opensearch/neuralsearch/processor/rerank/DocumentContextSourceFetcher.java b/src/main/java/org/opensearch/neuralsearch/processor/rerank/context/DocumentContextSourceFetcher.java similarity index 98% rename from src/main/java/org/opensearch/neuralsearch/processor/rerank/DocumentContextSourceFetcher.java rename to src/main/java/org/opensearch/neuralsearch/processor/rerank/context/DocumentContextSourceFetcher.java index 34fd42d86..2ed5b0713 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/rerank/DocumentContextSourceFetcher.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/rerank/context/DocumentContextSourceFetcher.java @@ -2,7 +2,7 @@ * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ -package org.opensearch.neuralsearch.processor.rerank; +package org.opensearch.neuralsearch.processor.rerank.context; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/org/opensearch/neuralsearch/processor/rerank/QueryContextSourceFetcher.java b/src/main/java/org/opensearch/neuralsearch/processor/rerank/context/QueryContextSourceFetcher.java similarity index 98% rename from src/main/java/org/opensearch/neuralsearch/processor/rerank/QueryContextSourceFetcher.java rename to src/main/java/org/opensearch/neuralsearch/processor/rerank/context/QueryContextSourceFetcher.java index b027e3f6f..18e5be20b 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/rerank/QueryContextSourceFetcher.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/rerank/context/QueryContextSourceFetcher.java @@ -2,7 +2,7 @@ * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ -package org.opensearch.neuralsearch.processor.rerank; +package org.opensearch.neuralsearch.processor.rerank.context; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/test/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactoryTests.java b/src/test/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactoryTests.java index fa15eda46..ec74f831a 100644 --- a/src/test/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactoryTests.java +++ b/src/test/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactoryTests.java @@ -16,10 +16,10 @@ import org.mockito.Mock; import org.opensearch.OpenSearchParseException; import org.opensearch.neuralsearch.ml.MLCommonsClientAccessor; -import org.opensearch.neuralsearch.processor.rerank.DocumentContextSourceFetcher; import org.opensearch.neuralsearch.processor.rerank.MLOpenSearchRerankProcessor; import org.opensearch.neuralsearch.processor.rerank.RerankProcessor; import org.opensearch.neuralsearch.processor.rerank.RerankType; +import org.opensearch.neuralsearch.processor.rerank.context.DocumentContextSourceFetcher; import org.opensearch.search.pipeline.Processor.PipelineContext; import org.opensearch.search.pipeline.SearchResponseProcessor; import org.opensearch.test.OpenSearchTestCase; diff --git a/src/test/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessorTests.java b/src/test/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessorTests.java index 018677b60..80297e5c7 100644 --- a/src/test/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessorTests.java +++ b/src/test/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessorTests.java @@ -36,6 +36,8 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.neuralsearch.ml.MLCommonsClientAccessor; import org.opensearch.neuralsearch.processor.factory.RerankProcessorFactory; +import org.opensearch.neuralsearch.processor.rerank.context.DocumentContextSourceFetcher; +import org.opensearch.neuralsearch.processor.rerank.context.QueryContextSourceFetcher; import org.opensearch.neuralsearch.query.NeuralQueryBuilder; import org.opensearch.neuralsearch.query.ext.RerankSearchExtBuilder; import org.opensearch.search.SearchExtBuilder;