diff --git a/build.gradle b/build.gradle index 0fff5011..de399608 100644 --- a/build.gradle +++ b/build.gradle @@ -72,7 +72,7 @@ dependencies { //testImplementation 'org.apache.lucene:lucene-test-framework:${luceneVersion}' runtimeOnly 'org.locationtech.spatial4j:spatial4j:0.7' runtimeOnly 'org.locationtech.jts:jts-core:1.15.0' - runtimeOnly 'org.apache.logging.log4j:log4j-core:2.20.0' + runtimeOnly 'org.apache.logging.log4j:log4j-core:2.21.0' } diff --git a/gradle.properties b/gradle.properties index 80429c01..903fe517 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -ltrVersion = 2.11.1 -opensearchVersion = 2.11.1 +ltrVersion = 2.15.0 +opensearchVersion = 2.15.0 luceneVersion = 9.7.0 ow2Version = 9.6 antlrVersion=4.11.1 diff --git a/src/main/java/com/o19s/es/explore/ExplorerQuery.java b/src/main/java/com/o19s/es/explore/ExplorerQuery.java index 76556f0f..efe2fe86 100644 --- a/src/main/java/com/o19s/es/explore/ExplorerQuery.java +++ b/src/main/java/com/o19s/es/explore/ExplorerQuery.java @@ -103,7 +103,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo StatisticsHelper ttf_stats = new StatisticsHelper(); for (Term term : terms) { - TermStates ctx = TermStates.build(searcher.getTopReaderContext(), term, scoreMode.needsScores()); + TermStates ctx = TermStates.build(searcher, term, scoreMode.needsScores()); if(ctx != null && ctx.docFreq() > 0){ TermStatistics tStats = searcher.termStatistics(term, ctx.docFreq(), ctx.totalTermFreq()); df_stats.add(tStats.docFreq()); diff --git a/src/main/java/com/o19s/es/explore/PostingsExplorerQuery.java b/src/main/java/com/o19s/es/explore/PostingsExplorerQuery.java index 0ee2e930..ad48341c 100644 --- a/src/main/java/com/o19s/es/explore/PostingsExplorerQuery.java +++ b/src/main/java/com/o19s/es/explore/PostingsExplorerQuery.java @@ -78,9 +78,8 @@ public int hashCode() { @Override public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException { - IndexReaderContext context = searcher.getTopReaderContext(); assert scoreMode.needsScores() : "Should not be used in filtering mode"; - return new PostingsExplorerWeight(this, this.term, TermStates.build(context, this.term, + return new PostingsExplorerWeight(this, this.term, TermStates.build(searcher, this.term, scoreMode.needsScores()), this.type); } diff --git a/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java b/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java index bcf233be..5ff0d856 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java @@ -336,7 +336,7 @@ static class LtrScriptWeight extends Weight { if (scoreMode.needsScores()) { for (Term t : terms) { - TermStates ctx = TermStates.build(searcher.getTopReaderContext(), t, true); + TermStates ctx = TermStates.build(searcher, t, true); if (ctx != null && ctx.docFreq() > 0) { searcher.collectionStatistics(t.field()); searcher.termStatistics(t, ctx.docFreq(), ctx.totalTermFreq()); diff --git a/src/main/java/com/o19s/es/termstat/TermStatQuery.java b/src/main/java/com/o19s/es/termstat/TermStatQuery.java index c124f19d..e33efe54 100644 --- a/src/main/java/com/o19s/es/termstat/TermStatQuery.java +++ b/src/main/java/com/o19s/es/termstat/TermStatQuery.java @@ -122,7 +122,7 @@ static class TermStatWeight extends Weight { // This is needed for proper DFS_QUERY_THEN_FETCH support if (scoreMode.needsScores()) { for (Term t : terms) { - TermStates ctx = TermStates.build(searcher.getTopReaderContext(), t, true); + TermStates ctx = TermStates.build(searcher, t, true); if (ctx != null && ctx.docFreq() > 0) { searcher.collectionStatistics(t.field());