Skip to content

Commit c43c9b6

Browse files
Fix bbq index feature exposure for testing & remove feature flag (#114832) (#114851)
We actually don't need a cluster feature, a capability added if the feature flag is enabled is enough for testing. closes #114787 (cherry picked from commit e87b894) Co-authored-by: Elastic Machine <[email protected]>
1 parent ff30815 commit c43c9b6

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.index.mapper;
1111

12-
import org.elasticsearch.common.util.set.Sets;
1312
import org.elasticsearch.features.FeatureSpecification;
1413
import org.elasticsearch.features.NodeFeature;
1514
import org.elasticsearch.index.IndexSettings;
@@ -24,7 +23,7 @@
2423
public class MapperFeatures implements FeatureSpecification {
2524
@Override
2625
public Set<NodeFeature> getFeatures() {
27-
Set<NodeFeature> features = Set.of(
26+
return Set.of(
2827
IgnoredSourceFieldMapper.TRACK_IGNORED_SOURCE,
2928
PassThroughObjectMapper.PASS_THROUGH_PRIORITY,
3029
RangeFieldMapper.NULL_VALUES_OFF_BY_ONE_FIX,
@@ -47,13 +46,9 @@ public Set<NodeFeature> getFeatures() {
4746
IndexSettings.IGNORE_ABOVE_INDEX_LEVEL_SETTING,
4847
SourceFieldMapper.SYNTHETIC_SOURCE_COPY_TO_INSIDE_OBJECTS_FIX,
4948
TimeSeriesRoutingHashFieldMapper.TS_ROUTING_HASH_FIELD_PARSES_BYTES_REF,
50-
FlattenedFieldMapper.IGNORE_ABOVE_WITH_ARRAYS_SUPPORT
49+
FlattenedFieldMapper.IGNORE_ABOVE_WITH_ARRAYS_SUPPORT,
50+
DenseVectorFieldMapper.BBQ_FORMAT
5151
);
52-
// BBQ is currently behind a feature flag for testing
53-
if (DenseVectorFieldMapper.BBQ_FEATURE_FLAG.isEnabled()) {
54-
return Sets.union(features, Set.of(DenseVectorFieldMapper.BBQ_FORMAT));
55-
}
56-
return features;
5752
}
5853

5954
@Override

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.apache.lucene.util.BytesRef;
3737
import org.apache.lucene.util.VectorUtil;
3838
import org.elasticsearch.common.ParsingException;
39-
import org.elasticsearch.common.util.FeatureFlag;
4039
import org.elasticsearch.common.xcontent.support.XContentMapValues;
4140
import org.elasticsearch.features.NodeFeature;
4241
import org.elasticsearch.index.IndexVersion;
@@ -110,7 +109,6 @@ public static boolean isNotUnitVector(float magnitude) {
110109
public static final NodeFeature INT4_QUANTIZATION = new NodeFeature("mapper.vectors.int4_quantization");
111110
public static final NodeFeature BIT_VECTORS = new NodeFeature("mapper.vectors.bit_vectors");
112111
public static final NodeFeature BBQ_FORMAT = new NodeFeature("mapper.vectors.bbq");
113-
public static final FeatureFlag BBQ_FEATURE_FLAG = new FeatureFlag("bbq_index_format");
114112

115113
public static final IndexVersion MAGNITUDE_STORED_INDEX_VERSION = IndexVersions.V_7_5_0;
116114
public static final IndexVersion INDEXED_BY_DEFAULT_INDEX_VERSION = IndexVersions.FIRST_DETACHED_INDEX_VERSION;
@@ -2259,9 +2257,6 @@ private static IndexOptions parseIndexOptions(String fieldName, Object propNode)
22592257
throw new MapperParsingException("Unknown vector index options type [" + type + "] for field [" + fieldName + "]");
22602258
}
22612259
VectorIndexType parsedType = vectorIndexType.get();
2262-
if ((parsedType == VectorIndexType.BBQ_FLAT || parsedType == VectorIndexType.BBQ_HNSW) && BBQ_FEATURE_FLAG.isEnabled() == false) {
2263-
throw new MapperParsingException("Unknown vector index options type [" + type + "] for field [" + fieldName + "]");
2264-
}
22652260
return parsedType.parseIndexOptions(fieldName, indexOptionsMap);
22662261
}
22672262

server/src/test/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapperTests.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363

6464
import static org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH;
6565
import static org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat.DEFAULT_MAX_CONN;
66-
import static org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper.BBQ_FEATURE_FLAG;
6766
import static org.hamcrest.Matchers.containsString;
6867
import static org.hamcrest.Matchers.equalTo;
6968
import static org.hamcrest.Matchers.instanceOf;
@@ -1228,11 +1227,9 @@ public void testInvalidParameters() {
12281227
e.getMessage(),
12291228
containsString("Failed to parse mapping: Mapping definition for [field] has unsupported parameters: [foo : {}]")
12301229
);
1231-
List<String> floatOnlyQuantizations = new ArrayList<>(Arrays.asList("int4_hnsw", "int8_hnsw", "int8_flat", "int4_flat"));
1232-
if (BBQ_FEATURE_FLAG.isEnabled()) {
1233-
floatOnlyQuantizations.add("bbq_hnsw");
1234-
floatOnlyQuantizations.add("bbq_flat");
1235-
}
1230+
List<String> floatOnlyQuantizations = new ArrayList<>(
1231+
Arrays.asList("int4_hnsw", "int8_hnsw", "int8_flat", "int4_flat", "bbq_hnsw", "bbq_flat")
1232+
);
12361233
for (String quantizationKind : floatOnlyQuantizations) {
12371234
e = expectThrows(
12381235
MapperParsingException.class,
@@ -1964,7 +1961,6 @@ public void testKnnQuantizedHNSWVectorsFormat() throws IOException {
19641961
}
19651962

19661963
public void testKnnBBQHNSWVectorsFormat() throws IOException {
1967-
assumeTrue("BBQ vectors are not supported in the current version", BBQ_FEATURE_FLAG.isEnabled());
19681964
final int m = randomIntBetween(1, DEFAULT_MAX_CONN + 10);
19691965
final int efConstruction = randomIntBetween(1, DEFAULT_BEAM_WIDTH + 10);
19701966
final int dims = randomIntBetween(64, 4096);
@@ -2003,7 +1999,6 @@ public void testKnnBBQHNSWVectorsFormat() throws IOException {
20031999
}
20042000

20052001
public void testInvalidVectorDimensionsBBQ() {
2006-
assumeTrue("BBQ vectors are not supported in the current version", BBQ_FEATURE_FLAG.isEnabled());
20072002
for (String quantizedFlatFormat : new String[] { "bbq_hnsw", "bbq_flat" }) {
20082003
MapperParsingException e = expectThrows(MapperParsingException.class, () -> createDocumentMapper(fieldMapping(b -> {
20092004
b.field("type", "dense_vector");

0 commit comments

Comments
 (0)