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

up opensearch version to 2.15.0 #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG opensearch_version=2.5.0
ARG opensearch_version=2.15.0

FROM opensearchproject/opensearch:${opensearch_version}
ARG opensearch_version=2.5.0
ARG ltrversion=2.1.0
ARG opensearch_version=2.15.0
ARG ltrversion=2.15.0
RUN /usr/share/opensearch/bin/opensearch-plugin install -b https://github.com/gsingers/opensearch-learning-to-rank-base/releases/download/release-v${ltrversion}/ltr-plugin-v${ltrversion}.zip


Expand Down
6 changes: 3 additions & 3 deletions docker/local.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Build an image from a local distribution

ARG opensearch_version=2.5.0
ARG opensearch_version=2.15.0
FROM opensearchproject/opensearch:${opensearch_version}
ARG ltrversion=2.1.0
ARG opensearch_version=2.5.0
ARG ltrversion=2.15.0
ARG opensearch_version=2.15.0
ARG zip_file=ltr-${ltrversion}-os${opensearch_version}.zip
ARG plugin_file=/usr/share/opensearch/${zip_file}

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.15.0
opensearchVersion = 2.15.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