Fix sparse vector test

This commit is contained in:
Alan Woodward 2020-11-12 20:10:07 +00:00
parent caf143f4a5
commit 0e2a9b4ac7
2 changed files with 15 additions and 1 deletions

View File

@ -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);

View File

@ -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<Plugin> getPlugins() {
return Collections.singletonList(new Vectors());