Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to build for OpenSearch 2.14.0 #35

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading