File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
server/src/main/java/org/elasticsearch/index/codec/vectors/es818 Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 2727import org .apache .lucene .codecs .lucene99 .Lucene99FlatVectorsWriter ;
2828import org .apache .lucene .index .SegmentReadState ;
2929import org .apache .lucene .index .SegmentWriteState ;
30+ import org .apache .lucene .store .IOContext .FileOpenHint ;
3031
3132import java .io .IOException ;
33+ import java .util .stream .Stream ;
3234
3335/**
3436 * Copied from Lucene99FlatVectorsFormat in Lucene 10.1
@@ -63,11 +65,12 @@ public FlatVectorsWriter fieldsWriter(SegmentWriteState state) throws IOExceptio
6365
6466 @ Override
6567 public FlatVectorsReader fieldsReader (SegmentReadState state ) throws IOException {
68+ var newHints = Stream .concat (state .context .hints ().stream (), Stream .of (DirectIOHint .INSTANCE )).toArray (FileOpenHint []::new );
6669 SegmentReadState directIOState = new SegmentReadState (
6770 state .directory ,
6871 state .segmentInfo ,
6972 state .fieldInfos ,
70- state .context .withHints (DirectIOHint . INSTANCE ),
73+ state .context .withHints (newHints ),
7174 state .segmentSuffix
7275 );
7376 // Use mmap for merges and direct I/O for searches.
You can’t perform that action at this time.
0 commit comments