vigyasharma commented on code in PR #14119:
URL: https://github.com/apache/lucene/pull/14119#discussion_r1909327166
##########
lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene92/OffHeapFloatVectorValues.java:
##########
@@ -256,7 +256,7 @@ public DocIndexIterator iterator() {
@Override
public Bits getAcceptOrds(Bits acceptDocs) {
- return null;
+ return new Bits.MatchNoBits(0);
Review Comment:
Hmm.. how should this API behave if a document is accepted but does not have
a vector ordinal? My understanding is that `Bits#get(int ord)` should return
false.. It should be true only when the doc is accepted _and_ it has a vector
ordinal.
A null return value accepts all ordinals. This is okay for dense vectors if
acceptDocs is `null`, but not for Empty and Sparse. Speaking of which, we
should probably also have this check for Sparse Vector Values. Suppose our max
ordinal today is N. Today the
[behavior](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapFloatVectorValues.java#L231)
for `acceptOrd().get(N+1)` changes depending on whether acceptDocs is null or
not. It should always be false.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]