hossman commented on issue #13105:
URL: https://github.com/apache/lucene/issues/13105#issuecomment-1945211363

   > ... as long as a new VectorEncoding method checkField(reader, fieldName) 
does not throw an exception (Adding checkField directly to VectorEncoding 
seemed like the most straightforward place to put this ... not sure if there is 
a more appropriate class?)
   
   The fact that this new method (in an otherwise bare bones `enum` class) had 
to be public kept gnawing at me -- so instead I refactored it into a package 
protected static method in `VectorFieldFunction`.
   
   I also added a simple test of the "field exists, but was not indexed with 
vectors" situation, and was surprised to discover that 
`FieldInfo.getVectorEncoding()` seems to default to `FLOAT32` (instead of null) 
when a field has no vectors -- so I added an explicit check of 
`FieldInfo.hasVectorValues()`
   
   Updated Patch: 
[VectorFieldSource.fix-missing-check.patch.txt](https://github.com/apache/lucene/files/14290130/VectorFieldSource.fix-missing-check.patch.txt)
   


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