File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 55public enum IndexProperty {
66 INDEXING_SEARCH_LIST_SIZE ,
77 QUANTIZATION_SIZE_IN_BYTES ,
8- VECTOR_INDEX_SHARD_KEYS ;
8+ VECTOR_INDEX_SHARD_KEYS ,
9+ QUANTIZER_TYPE ,
910}
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ public QuantizerType getQuantizerType() {
105105 * @return the SpatialSpec.
106106 */
107107 public CosmosVectorIndexSpec setQuantizerType (QuantizerType quantizerType ) {
108- if (quantizerType != null ) {
108+ if (validateIndexType ( IndexProperty . QUANTIZER_TYPE ) && quantizerType != null ) {
109109 this .quantizerType = quantizerType ;
110110 this .jsonSerializable .set (Constants .Properties .QUANTIZER_TYPE , quantizerType );
111111 } else {
@@ -223,7 +223,9 @@ JsonSerializable getJsonSerializable() {
223223
224224 private Boolean validateIndexType (IndexProperty indexProperty ) {
225225 String vectorIndexType = this .jsonSerializable .getString (Constants .Properties .VECTOR_INDEX_TYPE );
226- if (indexProperty .equals (IndexProperty .QUANTIZATION_SIZE_IN_BYTES ) || (indexProperty .equals (IndexProperty .VECTOR_INDEX_SHARD_KEYS ))) {
226+ if (indexProperty .equals (IndexProperty .QUANTIZATION_SIZE_IN_BYTES ) ||
227+ (indexProperty .equals (IndexProperty .VECTOR_INDEX_SHARD_KEYS )) ||
228+ (indexProperty .equals (IndexProperty .QUANTIZER_TYPE ))) {
227229 return vectorIndexType .equals (CosmosVectorIndexType .QUANTIZED_FLAT .toString ()) ||
228230 vectorIndexType .equals (CosmosVectorIndexType .DISK_ANN .toString ());
229231 }
You can’t perform that action at this time.
0 commit comments