Skip to content

Commit

Permalink
Changes to build for OpenSearch 2.14.0 (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: jzonthemtn <jeff.zemerick@mtnfog.com>
  • Loading branch information
jzonthemtn authored Sep 12, 2024
1 parent 6369a78 commit 980e3c6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}


Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ltrVersion = 2.11.1
opensearchVersion = 2.11.1
ltrVersion = 2.14.0
opensearchVersion = 2.14.0
luceneVersion = 9.7.0
ow2Version = 9.6
antlrVersion=4.11.1
2 changes: 1 addition & 1 deletion src/main/java/com/o19s/es/explore/ExplorerQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/o19s/es/explore/PostingsExplorerQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/o19s/es/termstat/TermStatQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 980e3c6

Please sign in to comment.