From 0e2a9b4ac792ff2f01185f29a4e35e5ff50d8477 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Thu, 12 Nov 2020 20:10:07 +0000 Subject: [PATCH] Fix sparse vector test --- .../elasticsearch/index/mapper/MapperTestCase.java | 2 +- .../mapper/SparseVectorFieldMapperTests.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java index 64c41f56045..054158a74c7 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java @@ -255,7 +255,7 @@ public abstract class MapperTestCase extends MapperServiceTestCase { return true; } - public final void testDeprecatedBoost() throws IOException { + public void testDeprecatedBoost() throws IOException { assumeTrue("Does not support [boost] parameter", supportsOrIgnoresBoost()); createMapperService(fieldMapping(b -> { minimalMapping(b); diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java index eb2c76a81c8..542065512e7 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java @@ -59,6 +59,20 @@ public class SparseVectorFieldMapperTests extends MapperTestCase { builder.startObject().field("1", 1).endObject(); } + @Override + public void testDeprecatedBoost() throws IOException { + assumeTrue("Does not support [boost] parameter", supportsOrIgnoresBoost()); + createMapperService(fieldMapping(b -> { + minimalMapping(b); + b.field("boost", 2.0); + })); + String type = typeName(); + String[] warnings = new String[] { + "The [sparse_vector] field type is deprecated and will be removed in 8.0.", + "Parameter [boost] has no effect on type [" + type + "] and will be removed in future" }; + allowedWarnings(warnings); + } + @Override protected Collection getPlugins() { return Collections.singletonList(new Vectors());