cpoerschke commented on code in PR #910:
URL: https://github.com/apache/solr/pull/910#discussion_r900367927


##########
solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java:
##########
@@ -124,19 +123,12 @@ public KnnVectorsFormat 
getKnnVectorsFormatForField(String field) {
             FieldType fieldType = (schemaField == null ? null : 
schemaField.getType());
             if (fieldType instanceof DenseVectorField) {
               DenseVectorField vectorType = (DenseVectorField) fieldType;
-              String knnVectorFormatName = vectorType.getCodecFormat();
-              if (knnVectorFormatName != null) {
-                if 
(knnVectorFormatName.equals(Lucene91HnswVectorsFormat.class.getSimpleName())) {
+              String knnAlgorithm = vectorType.getAlgorithm();
+              if (knnAlgorithm != null) {
+                if (knnAlgorithm.equals(DenseVectorField.HNSW_ALGORITHM)) {
                   int maxConn = vectorType.getHnswMaxConn();
                   int beamWidth = vectorType.getHnswBeamWidth();
                   return new Lucene91HnswVectorsFormat(maxConn, beamWidth);
-                } else if (knnVectorFormatName.equals(
-                    Lucene90HnswVectorsFormat.class.getSimpleName())) {
-                  int maxConn = vectorType.getHnswMaxConn();
-                  int beamWidth = vectorType.getHnswBeamWidth();
-                  return new Lucene90HnswVectorsFormat(maxConn, beamWidth);
-                } else {
-                  return KnnVectorsFormat.forName(knnVectorFormatName);
                 }

Review Comment:
   ```suggestion
                   } else {
                     // maybe log and/or throw so that any typos in 
`knnAlgorithm` don't go silently unnoticed
                   }
   ```



##########
solr/core/src/java/org/apache/solr/schema/DenseVectorField.java:
##########
@@ -142,8 +134,8 @@ public VectorSimilarityFunction getSimilarityFunction() {
     return similarityFunction;
   }
 
-  public String getCodecFormat() {
-    return codecFormat;
+  public String getAlgorithm() {
+    return algorithm;

Review Comment:
   With backwards compatibility in mind, could `codecFormat` perhaps be 
deprecated before it's removed e.g.
   
   Solr 9.1
   * `knnAlgorithm="..."` is supported
   * `codecFormat="..."` is deprecated but still supported
   * combination of `codecFormat="..."` and `knnAlgorithm="..."` is either not 
supported (throws error) or the `codecFormat` is logged as a warning and then 
ignored. whichever choice is easier to implement?
   
   Solr 9.2 or higher
   * only `knnAlgorithm="..."` is supported



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to