@@ -131,6 +131,7 @@ public static boolean isNotUnitVector(float magnitude) {
131
131
// vector
132
132
public static final int MAGNITUDE_BYTES = 4 ;
133
133
public static final int OVERSAMPLE_LIMIT = 10_000 ; // Max oversample allowed
134
+ private static final float DEFAULT_OVERSAMPLE = 3.0F ; // Default oversample value
134
135
135
136
private static DenseVectorFieldMapper toType (FieldMapper in ) {
136
137
return (DenseVectorFieldMapper ) in ;
@@ -1463,7 +1464,7 @@ public IndexOptions parseIndexOptions(String fieldName, Map<String, ?> indexOpti
1463
1464
if (indexVersion .onOrAfter (ADD_RESCORE_PARAMS_TO_QUANTIZED_VECTORS )) {
1464
1465
rescoreVector = RescoreVector .fromIndexOptions (indexOptionsMap , indexVersion );
1465
1466
if (rescoreVector == null ) {
1466
- rescoreVector = new RescoreVector (3.0f );
1467
+ rescoreVector = new RescoreVector (DEFAULT_OVERSAMPLE );
1467
1468
}
1468
1469
}
1469
1470
MappingParser .checkNoRemainingFields (fieldName , indexOptionsMap );
@@ -1486,6 +1487,9 @@ public IndexOptions parseIndexOptions(String fieldName, Map<String, ?> indexOpti
1486
1487
RescoreVector rescoreVector = null ;
1487
1488
if (indexVersion .onOrAfter (ADD_RESCORE_PARAMS_TO_QUANTIZED_VECTORS )) {
1488
1489
rescoreVector = RescoreVector .fromIndexOptions (indexOptionsMap , indexVersion );
1490
+ if (rescoreVector == null ) {
1491
+ rescoreVector = new RescoreVector (DEFAULT_OVERSAMPLE );
1492
+ }
1489
1493
}
1490
1494
MappingParser .checkNoRemainingFields (fieldName , indexOptionsMap );
1491
1495
return new BBQFlatIndexOptions (rescoreVector );
@@ -2314,6 +2318,10 @@ int getVectorDimensions() {
2314
2318
ElementType getElementType () {
2315
2319
return elementType ;
2316
2320
}
2321
+
2322
+ IndexOptions getIndexOptions () {
2323
+ return indexOptions ;
2324
+ }
2317
2325
}
2318
2326
2319
2327
private final IndexOptions indexOptions ;
0 commit comments