eliaporciani commented on code in PR #1435:
URL: https://github.com/apache/solr/pull/1435#discussion_r1138494823


##########
solr/core/src/java/org/apache/solr/schema/DenseVectorField.java:
##########
@@ -46,19 +50,17 @@
  */
 public class DenseVectorField extends FloatPointField {
   public static final String HNSW_ALGORITHM = "hnsw";
-
   public static final String DEFAULT_KNN_ALGORITHM = HNSW_ALGORITHM;
   static final String KNN_VECTOR_DIMENSION = "vectorDimension";
   static final String KNN_SIMILARITY_FUNCTION = "similarityFunction";
-
   static final String KNN_ALGORITHM = "knnAlgorithm";
   static final String HNSW_MAX_CONNECTIONS = "hnswMaxConnections";
   static final String HNSW_BEAM_WIDTH = "hnswBeamWidth";
-
+  static final String VECTOR_ENCODING = "vectorEncoding";
+  private final VectorEncoding DEFAULT_VECTOR_ENCODING = 
VectorEncoding.FLOAT32;
+  private final VectorSimilarityFunction DEFAULT_SIMILARITY = 
VectorSimilarityFunction.EUCLIDEAN;

Review Comment:
   fixed



##########
solr/core/src/java/org/apache/solr/schema/DenseVectorField.java:
##########
@@ -106,19 +114,22 @@ public void init(IndexSchema schema, Map<String, String> 
args) {
     args.remove(KNN_SIMILARITY_FUNCTION);
 
     this.knnAlgorithm = args.getOrDefault(KNN_ALGORITHM, 
DEFAULT_KNN_ALGORITHM);
-
     args.remove(KNN_ALGORITHM);
 
+    this.vectorEncoding =
+        ofNullable(args.get(VECTOR_ENCODING))
+            .map(value -> 
VectorEncoding.valueOf(value.toUpperCase(Locale.ROOT)))
+            .orElse(DEFAULT_VECTOR_ENCODING);
+    ;
+
+    args.remove(VECTOR_ENCODING);

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to