diff --git a/muted-tests.yml b/muted-tests.yml index 9e97373941ca5..7e098f3575b7e 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -562,9 +562,6 @@ tests: - class: org.elasticsearch.test.apmintegration.TracesApmIT method: testApmIntegration issue: https://github.com/elastic/elasticsearch/issues/129651 -- class: org.elasticsearch.search.query.RescoreKnnVectorQueryIT - method: testKnnSearchRescore - issue: https://github.com/elastic/elasticsearch/issues/129713 - class: org.elasticsearch.snapshots.SnapshotShutdownIT method: testSnapshotShutdownProgressTracker issue: https://github.com/elastic/elasticsearch/issues/129752 diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/RescoreKnnVectorQueryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/RescoreKnnVectorQueryIT.java index c8812cfc109f2..ea56eff355006 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/RescoreKnnVectorQueryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/RescoreKnnVectorQueryIT.java @@ -38,17 +38,20 @@ import org.junit.Before; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; +import static org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper.IVF_FORMAT; +import static org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper.VectorIndexType.BBQ_IVF; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailuresAndResponse; import static org.hamcrest.Matchers.equalTo; @@ -83,12 +86,14 @@ protected Map, Object>> pluginScripts() { @Before public void setup() throws IOException { - String type = randomFrom( - Arrays.stream(VectorIndexType.values()) - .filter(VectorIndexType::isQuantized) - .map(t -> t.name().toLowerCase(Locale.ROOT)) - .collect(Collectors.toCollection(ArrayList::new)) - ); + Set validIndexTypes = Arrays.stream(VectorIndexType.values()) + .filter(VectorIndexType::isQuantized) + .map(t -> t.name().toLowerCase(Locale.ROOT)) + .collect(Collectors.toCollection(HashSet::new)); + if (IVF_FORMAT.isEnabled() == false) { + validIndexTypes.remove(BBQ_IVF.name().toLowerCase(Locale.ROOT)); + } + String type = randomFrom(validIndexTypes); XContentBuilder mapping = XContentFactory.jsonBuilder() .startObject() .startObject("properties")