Skip to content

Commit

Permalink
2.13 compatiblity sans a fix for com.o19s.es.ltr.utils.Suppliers.Feat…
Browse files Browse the repository at this point in the history
…ureVectorSupplier
  • Loading branch information
jhinch-at-atlassian-com committed Aug 21, 2024
1 parent c2bda69 commit 44b9a42
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ validateNebulaPom.enabled = false
buildscript {
ext {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "2.11.0")
lucene_version = "9.7.0"
opensearch_version = System.getProperty("opensearch.version", "2.13.0")
lucene_version = "9.10.0"
plugin_version = opensearch_version + ".0"
if (isSnapshot) {
opensearch_version += "-SNAPSHOT"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
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 44b9a42

Please sign in to comment.