From 1e525379f156dc8bb2678e5b8969b2ed5caadbaf Mon Sep 17 00:00:00 2001 From: opensearch-ci-bot Date: Sat, 11 Nov 2023 00:06:41 +0000 Subject: [PATCH 1/2] Increment version to 2.12.0-SNAPSHOT Signed-off-by: opensearch-ci-bot --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d37a443ad..dd2ab1dcf 100644 --- a/build.gradle +++ b/build.gradle @@ -83,7 +83,7 @@ validateNebulaPom.enabled = false buildscript { ext { - opensearch_version = System.getProperty("opensearch.version", "2.11.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "2.12.0-SNAPSHOT") buildVersionQualifier = System.getProperty("build.version_qualifier", "") isSnapshot = "true" == System.getProperty("build.snapshot", "true") version_tokens = opensearch_version.tokenize('-') From 4d72772df727c5a6873a75eb2ecb82e8cd14fe47 Mon Sep 17 00:00:00 2001 From: Martin Gaievski Date: Mon, 20 Nov 2023 16:21:30 -0800 Subject: [PATCH 2/2] Fixed compilation errors after latest core upgrade Signed-off-by: Martin Gaievski --- .../java/org/apache/lucene/BoundedLinearFeatureQuery.java | 8 +++++--- .../opensearch/neuralsearch/plugin/NeuralSearchTests.java | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/lucene/BoundedLinearFeatureQuery.java b/src/main/java/org/apache/lucene/BoundedLinearFeatureQuery.java index 617662363..a914f3156 100644 --- a/src/main/java/org/apache/lucene/BoundedLinearFeatureQuery.java +++ b/src/main/java/org/apache/lucene/BoundedLinearFeatureQuery.java @@ -48,6 +48,7 @@ import org.apache.lucene.search.Explanation; import org.apache.lucene.search.ImpactsDISI; import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.MaxScoreCache; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.ScoreMode; @@ -170,7 +171,8 @@ public float score(float freq, long norm) { } }; final ImpactsEnum impacts = termsEnum.impacts(PostingsEnum.FREQS); - final ImpactsDISI impactsDisi = new ImpactsDISI(impacts, impacts, scorer); + MaxScoreCache maxScoreCache = new MaxScoreCache(impacts, scorer); + final ImpactsDISI impactsDisi = new ImpactsDISI(impacts, maxScoreCache); return new Scorer(this) { @@ -191,12 +193,12 @@ public DocIdSetIterator iterator() { @Override public int advanceShallow(int target) throws IOException { - return impactsDisi.advanceShallow(target); + return impactsDisi.getMaxScoreCache().advanceShallow(target); } @Override public float getMaxScore(int upTo) throws IOException { - return impactsDisi.getMaxScore(upTo); + return impactsDisi.getMaxScoreCache().getMaxScore(upTo); } @Override diff --git a/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java b/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java index 69791681e..32901cf12 100644 --- a/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java +++ b/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Optional; +import org.opensearch.indices.IndicesService; import org.opensearch.ingest.IngestService; import org.opensearch.ingest.Processor; import org.opensearch.neuralsearch.processor.NeuralQueryEnricherProcessor; @@ -66,7 +67,8 @@ public void testProcessors() { null, mock(IngestService.class), null, - null + null, + mock(IndicesService.class) ); Map processors = plugin.getProcessors(processorParams); assertNotNull(processors);