john-mlika commented on PR #16678:
URL: https://github.com/apache/lucene/pull/16678#issuecomment-5689270820

   the test doesn't need the function on any of the branches. 
Lucene99HnswVectorsReader already implements QuantizedVectorsReader, so we can 
cast the reader already in the test:
   
   ```diff
   -import org.apache.lucene.codecs.hnsw.FlatVectorsReader;
   +import org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil;
   @@
   -          Lucene99HnswVectorsReader hnswReader = 
(Lucene99HnswVectorsReader) vectorsReader;
   -          FlatVectorsReader flatReader = hnswReader.getFlatVectorsReader();
   -          QuantizedVectorsReader quantizedReader = (QuantizedVectorsReader) 
flatReader;
   +          QuantizedVectorsReader quantizedReader = (QuantizedVectorsReader) 
vectorsReader;
   @@
   -          FlatVectorsScorer searchScorer = 
flatReader.getFlatVectorScorer("f");
   +          FlatVectorsScorer searchScorer =
   +              new Lucene104ScalarQuantizedVectorScorer(
   +                  FlatVectorScorerUtil.getLucene99FlatVectorsScorer());
   ```
   
   the new function can then be deleted
   
   if that looks right, you can also pick the commit from my branch if that's 
easier: https://github.com/john-mlika/lucene/tree/backport-16665-no-new-api


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

Reply via email to