Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16588

solr.DenseVectorField fieldType without a knnAlgorithm parameter results in error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 9.1
    • 9.1.1
    • None

    Description

      Following the Dense Vector Search documentation at https://solr.apache.org/guide/solr/latest/query-guide/dense-vector-search.html

       

      Using a field definition of 

       

        <fieldType name="knn_vector" class="solr.DenseVectorField" vectorDimension="4" similarityFunction="euclidean"/>
        <field name="vector" type="knn_vector" multiValued="false" stored="true"/>

      And then trying to index a document results in an error in solr:

       

       

      2022-12-13 19:10:08.763 ERROR (qtp3540494-54) [ x:fsnn] o.a.s.s.HttpSolrCall org.apache.solr.common.SolrException: null KNN algorithm is not supported => org.apache.solr.common.SolrException: null KNN algorithm is not supported
      at org.apache.solr.core.SchemaCodecFactory$1.getKnnVectorsFormatForField(SchemaCodecFactory.java:134)
      org.apache.solr.common.SolrException: null KNN algorithm is not supported
      at org.apache.solr.core.SchemaCodecFactory$1.getKnnVectorsFormatForField(SchemaCodecFactory.java:134) ~[?:?]
      at org.apache.lucene.codecs.lucene92.Lucene92Codec$3.getKnnVectorsFormatForField(Lucene92Codec.java:101) ~[?:?]
      at org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat$FieldsWriter.getInstance(PerFieldKnnVectorsFormat.java:148) ~[?:?]
      at org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat$FieldsWriter.writeField(PerFieldKnnVectorsFormat.java:107) ~[?:?]
      at org.apache.lucene.index.VectorValuesWriter.flush(VectorValuesWriter.java:145) ~[?:?]
      at org.apache.lucene.index.IndexingChain.writeVectors(IndexingChain.java:461) ~[?:?] 

      This appears to be related to the changes introduced in SOLR-16245

       

      Adding a parameter knnAlgorithm="hnsw" to the fieldType definition causes the indexing process to work as expected

      Attachments

        Issue Links

          Activity

            People

              abenedetti Alessandro Benedetti
              alastairp Alastair Porter
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m