From 3c59e6148327bcf7ff42a72230effbb3b7853bf6 Mon Sep 17 00:00:00 2001 From: Kathleen DeRusso Date: Mon, 9 Dec 2024 15:25:55 -0500 Subject: [PATCH] Fix tests --- .../test/java/org/elasticsearch/index/IndexModuleTests.java | 2 +- .../internal/rewriter}/MockQueryRewriteInterceptor.java | 3 +-- .../org/elasticsearch/test/AbstractBuilderTestCase.java | 4 ++-- .../elasticsearch/xpack/inference/InferenceFeatures.java | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) rename test/framework/src/main/java/org/elasticsearch/{test/index/query => plugins/internal/rewriter}/MockQueryRewriteInterceptor.java (88%) diff --git a/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java b/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java index 1f708ae868b70..2a8a308e5dc02 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java @@ -92,7 +92,7 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.IndexSettingsModule; import org.elasticsearch.test.engine.MockEngineFactory; -import org.elasticsearch.test.index.query.MockQueryRewriteInterceptor; +import org.elasticsearch.plugins.internal.rewriter.MockQueryRewriteInterceptor; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; import org.hamcrest.Matchers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/index/query/MockQueryRewriteInterceptor.java b/test/framework/src/main/java/org/elasticsearch/plugins/internal/rewriter/MockQueryRewriteInterceptor.java similarity index 88% rename from test/framework/src/main/java/org/elasticsearch/test/index/query/MockQueryRewriteInterceptor.java rename to test/framework/src/main/java/org/elasticsearch/plugins/internal/rewriter/MockQueryRewriteInterceptor.java index 292dd39fbd79e..ebb03deb08f46 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/index/query/MockQueryRewriteInterceptor.java +++ b/test/framework/src/main/java/org/elasticsearch/plugins/internal/rewriter/MockQueryRewriteInterceptor.java @@ -7,11 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -package org.elasticsearch.test.index.query; +package org.elasticsearch.plugins.internal.rewriter; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; -import org.elasticsearch.index.query.QueryRewriteInterceptor; public class MockQueryRewriteInterceptor implements QueryRewriteInterceptor { diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java index 97185bbce255b..19e720fd64ef3 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java @@ -55,7 +55,6 @@ import org.elasticsearch.index.query.CoordinatorRewriteContext; import org.elasticsearch.index.query.DataRewriteContext; import org.elasticsearch.index.query.QueryRewriteContext; -import org.elasticsearch.index.query.QueryRewriteInterceptor; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.shard.IndexLongFieldRange; import org.elasticsearch.index.shard.ShardLongFieldRange; @@ -72,6 +71,7 @@ import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.plugins.ScriptPlugin; import org.elasticsearch.plugins.SearchPlugin; +import org.elasticsearch.plugins.internal.rewriter.QueryRewriteInterceptor; import org.elasticsearch.plugins.scanners.StablePluginsRegistry; import org.elasticsearch.script.MockScriptEngine; import org.elasticsearch.script.MockScriptService; @@ -82,7 +82,7 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.index.IndexVersionUtils; -import org.elasticsearch.test.index.query.MockQueryRewriteInterceptor; +import org.elasticsearch.plugins.internal.rewriter.MockQueryRewriteInterceptor; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.transport.RemoteClusterAware; import org.elasticsearch.xcontent.NamedXContentRegistry; diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceFeatures.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceFeatures.java index df855a50c9d3e..38adab7137536 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceFeatures.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceFeatures.java @@ -30,7 +30,8 @@ public Set getFeatures() { SemanticTextFieldMapper.SEMANTIC_TEXT_SEARCH_INFERENCE_ID, SemanticQueryBuilder.SEMANTIC_TEXT_INNER_HITS, SemanticTextFieldMapper.SEMANTIC_TEXT_DEFAULT_ELSER_2, - TextSimilarityRankRetrieverBuilder.TEXT_SIMILARITY_RERANKER_COMPOSITION_SUPPORTED + TextSimilarityRankRetrieverBuilder.TEXT_SIMILARITY_RERANKER_COMPOSITION_SUPPORTED, + SemanticMatchQueryRewriteInterceptor.SEMANTIC_MATCH_QUERY_REWRITE_INTERCEPTION_SUPPORTED ); } @@ -41,8 +42,7 @@ public Set getTestFeatures() { SemanticTextFieldMapper.SEMANTIC_TEXT_SINGLE_FIELD_UPDATE_FIX, SemanticTextFieldMapper.SEMANTIC_TEXT_DELETE_FIX, SemanticTextFieldMapper.SEMANTIC_TEXT_ZERO_SIZE_FIX, - SemanticTextFieldMapper.SEMANTIC_TEXT_ALWAYS_EMIT_INFERENCE_ID_FIX, - SemanticMatchQueryRewriteInterceptor.SEMANTIC_MATCH_QUERY_REWRITE_INTERCEPTION_SUPPORTED + SemanticTextFieldMapper.SEMANTIC_TEXT_ALWAYS_EMIT_INFERENCE_ID_FIX ); } }