Skip to content

Commit

Permalink
update to lucene 9.12
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <[email protected]>
  • Loading branch information
sbcd90 committed Oct 10, 2024
1 parent ce2989e commit 196ecf8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
*/
package org.opensearch.securityanalytics.correlation.index.codec;

import org.apache.lucene.backward_codecs.lucene99.Lucene99Codec;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.lucene99.Lucene99Codec;
import org.apache.lucene.codecs.lucene912.Lucene912Codec;
import org.apache.lucene.backward_codecs.lucene95.Lucene95Codec;
import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.securityanalytics.correlation.index.codec.correlation9120.CorrelationCodec9120;
import org.opensearch.securityanalytics.correlation.index.codec.correlation950.CorrelationCodec950;
import org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990;
import org.opensearch.securityanalytics.correlation.index.codec.correlation990.PerFieldCorrelationVectorsFormat990;
Expand All @@ -32,9 +34,16 @@ public enum CorrelationCodecVersion {
new PerFieldCorrelationVectorsFormat990(Optional.empty()),
(userCodec, mapperService) -> new CorrelationCodec990(userCodec, new PerFieldCorrelationVectorsFormat990(Optional.of(mapperService))),
CorrelationCodec990::new
),
V_9_12_0(
"CorrelationCodec9120",
new Lucene912Codec(),
new PerFieldCorrelationVectorsFormat990(Optional.empty()),
(userCodec, mapperService) -> new CorrelationCodec9120(userCodec, new PerFieldCorrelationVectorsFormat990(Optional.of(mapperService))),
CorrelationCodec9120::new
);

private static final CorrelationCodecVersion CURRENT = V_9_9_0;
private static final CorrelationCodecVersion CURRENT = V_9_12_0;
private final String codecName;
private final Codec defaultCodecDelegate;
private final PerFieldKnnVectorsFormat perFieldKnnVectorsFormat;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
package org.opensearch.securityanalytics.correlation.index.codec.correlation9120;

import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.FilterCodec;
import org.apache.lucene.codecs.KnnVectorsFormat;
import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat;
import org.opensearch.securityanalytics.correlation.index.codec.CorrelationCodecVersion;

public class CorrelationCodec9120 extends FilterCodec {
private static final CorrelationCodecVersion VERSION = CorrelationCodecVersion.V_9_12_0;
private final PerFieldKnnVectorsFormat perFieldCorrelationVectorsFormat;

public CorrelationCodec9120() {
this(VERSION.getDefaultCodecDelegate(), VERSION.getPerFieldCorrelationVectorsFormat());
}

public CorrelationCodec9120(Codec delegate, PerFieldKnnVectorsFormat perFieldCorrelationVectorsFormat) {
super(VERSION.getCodecName(), delegate);
this.perFieldCorrelationVectorsFormat = perFieldCorrelationVectorsFormat;
}

@Override
public KnnVectorsFormat knnVectorsFormat() {
return perFieldCorrelationVectorsFormat;
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
org.opensearch.securityanalytics.correlation.index.codec.correlation950.CorrelationCodec950
org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990
org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990
org.opensearch.securityanalytics.correlation.index.codec.correlation9120.CorrelationCodec9120

0 comments on commit 196ecf8

Please sign in to comment.