ChrisHegarty commented on code in PR #14076: URL: https://github.com/apache/lucene/pull/14076#discussion_r1888686757
########## lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99FlatVectorsWriter.java: ########## @@ -282,7 +285,7 @@ public CloseableRandomVectorScorerSupplier mergeOneFieldToIndex( // to perform random reads. vectorDataInput = segmentWriteState.directory.openInput( - tempVectorData.getName(), IOContext.DEFAULT.withReadAdvice(ReadAdvice.RANDOM)); + tempVectorData.getName(), IOContext.DEFAULT.withReadAdvice(readAdvice)); Review Comment: this is only ever used for the scorer, right? And it always be used only for HNSW? Either the comment above should be updated or the random advice restored. ( I'm sure I've missed something here ) ########## lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99FlatVectorsFormat.java: ########## @@ -78,21 +79,23 @@ public final class Lucene99FlatVectorsFormat extends FlatVectorsFormat { static final int DIRECT_MONOTONIC_BLOCK_SHIFT = 16; private final FlatVectorsScorer vectorsScorer; + private final ReadAdvice readAdvice; /** Constructs a format */ - public Lucene99FlatVectorsFormat(FlatVectorsScorer vectorsScorer) { + public Lucene99FlatVectorsFormat(FlatVectorsScorer vectorsScorer, ReadAdvice readAdvice) { Review Comment: ++ allowing to pass the read advice here is good, since the higher-level usage of this format really should dictate the intended usage. -- 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