jpountz commented on issue #11963:
URL: https://github.com/apache/lucene/issues/11963#issuecomment-1324845550

   > the types should be distinguished in fieldinfos today as well (not sure if 
that is currently the case)
   
   They are, `FieldInfo#vectorEncoding`.
   
   Trying to list what the change would look like:
    - Split `KnnVectorField` into `KnnFloatVectorField` and 
`KnnByteVectorField`.
    - Split `VectorValues` into `FloatVectorValues` and `ByteVectorValues`. 
`FloatVectorValues` would no longer expose its binary encoded value.
    - Split `VectorValues LeafReader#getVectorValues` into `ByteVectorValues 
LeafReader#getByteVectorValues` and `FloatVectorValues 
LeafReader#getFloatVectorValues`. These methods would return `null` if the 
field was indexed with the other type, like we're doing for doc values.
    - Split `LeafReader#searchNearestVectors` into one method that takes a 
`byte[]` and another one that takes a `float[]`. These methods would return 
empty hits if called with the wrong vector type, which would be consistent with 
exhaustive search by iterating over all vector values for the considered type.
    - Split `KnnVectorQuery` into `KnnFloatVectorQuery` and `KnnByteVectorQuery`
   
   Some questions:
    - Returning `null` instances for the wrong type in 
`LeadReader#getFloatVectorValues` would be consistent with doc values, but I 
wonder if we should rather fail in order to catch issues early. I can't think 
of a single case when it would be desirable to be lenient?
    - Generics would require passing array classes to a number of these 
methods, which I don't like much for only two types that need to be 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...@lucene.apache.org

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


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

Reply via email to