kaivalnp opened a new pull request, #12922:
URL: https://github.com/apache/lucene/pull/12922

   Discovered in #12921, and introduced in #12679 
   
   The first issue is that we weren't advancing the `VectorScorer` 
[here](https://github.com/apache/lucene/blob/cf13a9295052288b748ed8f279f05ee26f3bfd5f/lucene/core/src/java/org/apache/lucene/search/AbstractVectorSimilarityQuery.java#L257-L262)
 -- so it was still un-positioned while trying to compute the similarity score
   
   Earlier in the PR, the underlying delegate of the `FilteredDocIdSetIterator` 
was `scorer.iterator()` (see 
[here](https://github.com/apache/lucene/blob/cad565439be512ac6e95a698007b1fc971173f00/lucene/core/src/java/org/apache/lucene/search/AbstractVectorSimilarityQuery.java#L107))
 -- so we didn't need to explicitly advance it
   
   Later, we decided to maintain parity to `AbstractKnnVectorQuery` and 
introduce filtering in `AbstractVectorSimilarityQuery` (see [this 
commit](https://github.com/apache/lucene/commit/5096790f281e477c529a7c8311aeb353ccdffdeb))
 to determine the `visitLimit` of approximate search -- after which the 
underlying iterator changed to the accepted docs (see 
[here](https://github.com/apache/lucene/blob/5096790f281e477c529a7c8311aeb353ccdffdeb/lucene/core/src/java/org/apache/lucene/search/AbstractVectorSimilarityQuery.java#L255))
 and I missed advancing the `VectorScorer` explicitly..
   
   After doing so, we no longer get the original 
`java.lang.ArrayIndexOutOfBoundsException` -- but the 
`BaseVectorSimilarityQueryTestCase#testApproximate` starts failing because it 
falls back to exact search, as the limit of the prefilter is met during graph 
search
   
   Relaxed the parameters of the test to fix this (making the filter less 
restrictive, and trying to visit a fewer number of nodes so that approximate 
search completes without hitting its limit)
   
   Sorry for missing this earlier!


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