Browse Source

Fix for RescoreKnnVectorQueryIT to ensure that BBQ_IVF format is enabled (#129830)

Panagiotis Bailis 3 months ago
parent
commit
7d4bbcc4bb

+ 6 - 9
muted-tests.yml

@@ -559,21 +559,18 @@ 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
 - class: org.elasticsearch.xpack.security.SecurityRolesMultiProjectIT
   method: testUpdatingFileBasedRoleAffectsAllProjects
   issue: https://github.com/elastic/elasticsearch/issues/129775
-- class: org.elasticsearch.search.query.RescoreKnnVectorQueryIT
-  method: testKnnQueryRescore
-  issue: https://github.com/elastic/elasticsearch/issues/129809
-- class: org.elasticsearch.search.query.RescoreKnnVectorQueryIT
-  method: testKnnRetriever
-  issue: https://github.com/elastic/elasticsearch/issues/129818
+- class: org.elasticsearch.qa.verify_version_constants.VerifyVersionConstantsIT
+  method: testLuceneVersionConstant
+  issue: https://github.com/elastic/elasticsearch/issues/125638
+- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
+  method: test
+  issue: https://github.com/elastic/elasticsearch/issues/129819
 - class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
   method: testAbortingOrRunningMergeTaskHoldsUpBudget
   issue: https://github.com/elastic/elasticsearch/issues/129823

+ 1 - 1
server/src/internalClusterTest/java/org/elasticsearch/search/query/RescoreKnnVectorQueryIT.java

@@ -85,7 +85,7 @@ public class RescoreKnnVectorQueryIT extends ESIntegTestCase {
     public void setup() throws IOException {
         String type = randomFrom(
             Arrays.stream(VectorIndexType.values())
-                .filter(VectorIndexType::isQuantized)
+                .filter(t -> t.isQuantized() && t.isEnabled())
                 .map(t -> t.name().toLowerCase(Locale.ROOT))
                 .collect(Collectors.toCollection(ArrayList::new))
         );

+ 10 - 1
server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

@@ -1655,11 +1655,16 @@ public class DenseVectorFieldMapper extends FieldMapper {
             public boolean supportsDimension(int dims) {
                 return true;
             }
+
+            @Override
+            public boolean isEnabled() {
+                return IVF_FORMAT.isEnabled();
+            }
         };
 
         public static Optional<VectorIndexType> fromString(String type) {
             return Stream.of(VectorIndexType.values())
-                .filter(vectorIndexType -> vectorIndexType != VectorIndexType.BBQ_IVF || IVF_FORMAT.isEnabled())
+                .filter(VectorIndexType::isEnabled)
                 .filter(vectorIndexType -> vectorIndexType.name.equals(type))
                 .findFirst();
         }
@@ -1686,6 +1691,10 @@ public class DenseVectorFieldMapper extends FieldMapper {
             return quantized;
         }
 
+        public boolean isEnabled() {
+            return true;
+        }
+
         public String getName() {
             return name;
         }