benwtrent commented on code in PR #13235:
URL: https://github.com/apache/lucene/pull/13235#discussion_r1544581927


##########
lucene/join/src/java/org/apache/lucene/search/join/DiversifyingChildrenByteKnnVectorQuery.java:
##########
@@ -140,6 +140,10 @@ protected TopDocs approximateSearch(
     if (collector == null) {
       return NO_RESULTS;
     }
+    if (context.reader().getByteVectorValues(field) == null) {

Review Comment:
   Ah, I could move it higher. 
   
   > why do we only perform this validation when byte vector values are null?
   
   The contract is really that codec EITHER has byte vector values or float 
vector values.
   
   Null is returned:
   
    - if the field is missing
    - If there are no vectors in the field at all (dims == 0)
    - If the storage is vectors is the incorrect element type (byte vs. float)
   
   So, if `getByteVectorValues` actually returns non-null, we know that byte 
vector search is valid and thus we can continue on.
   
   However, if its `null`, we must verify the other conditions aren't the 
reason why it is null.



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