Skip to content

Commit

Permalink
Use 95 codec for reading and writing the documents with Updated Lucen…
Browse files Browse the repository at this point in the history
…e Codec

Signed-off-by: Navneet Verma <navneev@amazon.com>
  • Loading branch information
navneet1v committed Apr 30, 2024
1 parent 1961e58 commit 1005401
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FilterCodec;
import org.apache.lucene.codecs.KnnVectorsFormat;
import org.apache.lucene.codecs.SegmentInfoFormat;
import org.apache.lucene.codecs.lucene99.Lucene99SegmentInfoFormat;
import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat;
import org.opensearch.knn.index.codec.KNNCodecVersion;
import org.opensearch.knn.index.codec.KNNFormatFacade;
Expand All @@ -20,6 +22,8 @@ public class KNN950Codec extends FilterCodec {
private final KNNFormatFacade knnFormatFacade;
private final PerFieldKnnVectorsFormat perFieldKnnVectorsFormat;

private final SegmentInfoFormat segmentInfoFormat = new Lucene99SegmentInfoFormat();

/**
* No arg constructor that uses Lucene95 as the delegate
*/
Expand Down Expand Up @@ -55,4 +59,9 @@ public CompoundFormat compoundFormat() {
public KnnVectorsFormat knnVectorsFormat() {
return perFieldKnnVectorsFormat;
}

@Override
public SegmentInfoFormat segmentInfoFormat() {
return segmentInfoFormat;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public enum KNNCodecVersion {
KNN990Codec::new
);

private static final KNNCodecVersion CURRENT = V_9_9_0;
private static final KNNCodecVersion CURRENT = V_9_5_0;

private final String codecName;
private final Codec defaultCodecDelegate;
Expand Down

0 comments on commit 1005401

Please sign in to comment.