Skip to content

Commit

Permalink
Change version to opensearch version alpha1
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo committed Jan 23, 2025
1 parent 88b0e08 commit 8b61241
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ buildscript {
ext {
opensearch_group = "org.opensearch"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-alpha1-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1")
asm_version = "9.7"

// 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
Expand All @@ -25,7 +25,7 @@ buildscript {
opensearch_build += "-SNAPSHOT"
}

common_utils_version = System.getProperty("common_utils.version", opensearch_build)
common_utils_version = System.getProperty("common_utils.version", "3.0.0.0-SNAPSHOT")
kotlin_version = System.getProperty("kotlin.version", "1.9.23")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public void testCanQueryOverConversationsByAdditionalInfo() {
log.info(response.toString());
cdl.countDown();
assert (response.getHits().getAt(0).getId().equals(convo1.result()));
Assert.assertEquals(1L, Objects.requireNonNull(response.getHits().getTotalHits()).value);
Assert.assertEquals(1L, Objects.requireNonNull(response.getHits().getTotalHits()).value());
}, e -> {
cdl.countDown();
log.error(e);
Expand Down
3 changes: 2 additions & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}"
implementation "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
// Multi-tenant SDK Client
implementation "org.opensearch:opensearch-remote-metadata-sdk:${opensearch_build}"
implementation "org.opensearch:opensearch-remote-metadata-sdk:3.0.0-SNAPSHOT"

implementation "org.opensearch:common-utils:${common_utils_version}"
implementation("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
Expand Down Expand Up @@ -367,6 +367,7 @@ configurations.all {
resolutionStrategy.force "org.apache.logging.log4j:log4j-api:2.24.2"
resolutionStrategy.force "org.apache.logging.log4j:log4j-core:2.24.2"
resolutionStrategy.force "jakarta.json:jakarta.json-api:2.1.3"
resolutionStrategy.force "org.opensearch:opensearch:3.0.0-alpha1-SNAPSHOT"
}

apply plugin: 'com.netflix.nebula.ospackage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Optional;
import java.util.stream.Collectors;

import org.apache.lucene.search.TotalHits;
import org.opensearch.OpenSearchStatusException;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.search.SearchResponse;
Expand Down Expand Up @@ -142,7 +143,7 @@ public void search(SearchRequest request, ActionListener<SearchResponse> actionL
.ofNullable(r)
.map(SearchResponse::getHits)
.map(SearchHits::getTotalHits)
.map(x -> x.value)
.map(TotalHits::value)
.orElse(0L) > 0) {
List<String> modelGroupIds = new ArrayList<>();
Arrays.stream(r.getHits().getHits()).forEach(hit -> { modelGroupIds.add(hit.getId()); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void testReplaceHitsWithSearchHits() throws IOException {
assertNotNull(newResponse);
assertEquals(newHits.length, newResponse.getHits().getHits().length);
assertEquals(15, newResponse.getHits().getTotalHits().value());
assertEquals(TotalHits.Relation.EQUAL_TO, newResponse.getHits().getTotalHits().relation);
assertEquals(TotalHits.Relation.EQUAL_TO, newResponse.getHits().getTotalHits().relation());
assertEquals(0.7f, newResponse.getHits().getMaxScore(), 0.0001f);
}

Expand All @@ -132,7 +132,7 @@ public void testReplaceHitsWithNonWriteableAggregations() {
assertNotNull(newResponse);
assertEquals(newHits.length, newResponse.getHits().getHits().length);
assertEquals(15, newResponse.getHits().getTotalHits().value());
assertEquals(TotalHits.Relation.EQUAL_TO, newResponse.getHits().getTotalHits().relation);
assertEquals(TotalHits.Relation.EQUAL_TO, newResponse.getHits().getTotalHits().relation());
assertEquals(0.7f, newResponse.getHits().getMaxScore(), 0.0001f);
}

Expand Down

0 comments on commit 8b61241

Please sign in to comment.