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


##########
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:
   I changed the code in order to raise a SolrException in the else branch



-- 
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