From 8fd594cbe04606859c60ff56279dd34f6e9d012e Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Wed, 18 Sep 2024 08:44:03 +0200 Subject: [PATCH] HSEARCH-5245 Add compatibility with OpenSearch 2.17.0 --- Jenkinsfile | 3 ++- .../dialect/impl/ElasticsearchDialectFactory.java | 2 +- .../impl/ElasticsearchDialectFactoryTest.java | 12 ++++++++++-- .../amazon-opensearch-serverless.Dockerfile | 2 +- build/container/search-backend/opensearch.Dockerfile | 2 +- build/parents/build/pom.xml | 4 ++-- .../util/ElasticsearchTckBackendFeatures.java | 2 +- .../showcase/library/LibraryShowcaseSearchIT.java | 2 +- 8 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9bb9415e94c..004a5d78397 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -291,7 +291,8 @@ stage('Configure') { new LocalOpenSearchBuildEnvironment(version: '2.13.0', condition: TestCondition.ON_DEMAND), new LocalOpenSearchBuildEnvironment(version: '2.14.0', condition: TestCondition.ON_DEMAND), new LocalOpenSearchBuildEnvironment(version: '2.15.0', condition: TestCondition.ON_DEMAND), - new LocalOpenSearchBuildEnvironment(version: '2.16.0', condition: TestCondition.BEFORE_MERGE), + new LocalOpenSearchBuildEnvironment(version: '2.16.0', condition: TestCondition.ON_DEMAND), + new LocalOpenSearchBuildEnvironment(version: '2.17.0', condition: TestCondition.BEFORE_MERGE), // See https://opensearch.org/lines/2x.html for a list of all 2.x versions // IMPORTANT: Make sure to update the documentation for any newly supported OpenSearch versions // See version.org.opensearch.compatible.expected.text diff --git a/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactory.java b/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactory.java index 895b0241431..fa62ad48617 100644 --- a/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactory.java +++ b/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactory.java @@ -245,7 +245,7 @@ private ElasticsearchProtocolDialect createProtocolDialectOpenSearchV1(Elasticse } private ElasticsearchProtocolDialect createProtocolDialectOpenSearchV2(ElasticsearchVersion version, int minor) { - if ( minor > 16 ) { + if ( minor > 17 ) { log.unknownElasticsearchVersion( version ); } return new Elasticsearch70ProtocolDialect(); diff --git a/backend/elasticsearch/src/test/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactoryTest.java b/backend/elasticsearch/src/test/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactoryTest.java index e0368061c94..8de3c569559 100644 --- a/backend/elasticsearch/src/test/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactoryTest.java +++ b/backend/elasticsearch/src/test/java/org/hibernate/search/backend/elasticsearch/dialect/impl/ElasticsearchDialectFactoryTest.java @@ -428,14 +428,22 @@ public static List params() { ElasticsearchDistributionName.OPENSEARCH, "2.16.0", "2.16.0", OpenSearch214ModelDialect.class, Elasticsearch70ProtocolDialect.class ), - successWithWarning( + success( ElasticsearchDistributionName.OPENSEARCH, "2.17", "2.17.0", OpenSearch214ModelDialect.class, Elasticsearch70ProtocolDialect.class ), - successWithWarning( + success( ElasticsearchDistributionName.OPENSEARCH, "2.17.0", "2.17.0", OpenSearch214ModelDialect.class, Elasticsearch70ProtocolDialect.class ), + successWithWarning( + ElasticsearchDistributionName.OPENSEARCH, "2.18", "2.18.0", + OpenSearch214ModelDialect.class, Elasticsearch70ProtocolDialect.class + ), + successWithWarning( + ElasticsearchDistributionName.OPENSEARCH, "2.18.0", "2.18.0", + OpenSearch214ModelDialect.class, Elasticsearch70ProtocolDialect.class + ), successWithWarning( ElasticsearchDistributionName.OPENSEARCH, "3", "3.0.0", OpenSearch214ModelDialect.class, Elasticsearch70ProtocolDialect.class diff --git a/build/container/search-backend/amazon-opensearch-serverless.Dockerfile b/build/container/search-backend/amazon-opensearch-serverless.Dockerfile index 7e03d5e20d6..ac2d15d56bf 100644 --- a/build/container/search-backend/amazon-opensearch-serverless.Dockerfile +++ b/build/container/search-backend/amazon-opensearch-serverless.Dockerfile @@ -4,4 +4,4 @@ # IMPORTANT! When updating the version of OpenSearch in this Dockerfile, # make sure to update `version.org.opensearch.latest` property in a POM file, # and to update the version in opensearch.Dockerfile as well. -FROM docker.io/opensearchproject/opensearch:2.16.0 \ No newline at end of file +FROM docker.io/opensearchproject/opensearch:2.17.0 diff --git a/build/container/search-backend/opensearch.Dockerfile b/build/container/search-backend/opensearch.Dockerfile index 13ea1618a48..95f4ef39eca 100644 --- a/build/container/search-backend/opensearch.Dockerfile +++ b/build/container/search-backend/opensearch.Dockerfile @@ -4,4 +4,4 @@ # IMPORTANT! When updating the version of OpenSearch in this Dockerfile, # make sure to update `version.org.opensearch.latest` property in a POM file, # and to update the version in amazon-opensearch-serverless.Dockerfile as well. -FROM docker.io/opensearchproject/opensearch:2.16.0 \ No newline at end of file +FROM docker.io/opensearchproject/opensearch:2.17.0 diff --git a/build/parents/build/pom.xml b/build/parents/build/pom.xml index 96683784e84..d146e421f2f 100644 --- a/build/parents/build/pom.xml +++ b/build/parents/build/pom.xml @@ -69,13 +69,13 @@ --> - 1.3 or 2.16 + 1.3 or 2.17 1.3 or 2.x - 2.16.0 + 2.17.0 ${version.org.opensearch.latest} https://opensearch.org/docs/${parsed-version.org.opensearch.compatible.main.majorVersion}.${parsed-version.org.opensearch.compatible.main.minorVersion} diff --git a/integrationtest/backend/elasticsearch/src/test/java/org/hibernate/search/integrationtest/backend/elasticsearch/testsupport/util/ElasticsearchTckBackendFeatures.java b/integrationtest/backend/elasticsearch/src/test/java/org/hibernate/search/integrationtest/backend/elasticsearch/testsupport/util/ElasticsearchTckBackendFeatures.java index a1ef463f2d3..debe69120ea 100644 --- a/integrationtest/backend/elasticsearch/src/test/java/org/hibernate/search/integrationtest/backend/elasticsearch/testsupport/util/ElasticsearchTckBackendFeatures.java +++ b/integrationtest/backend/elasticsearch/src/test/java/org/hibernate/search/integrationtest/backend/elasticsearch/testsupport/util/ElasticsearchTckBackendFeatures.java @@ -485,7 +485,7 @@ public boolean rangeAggregationsDoNotIgnoreQuery() { // leading to routes, being ignored and incorrect counts produced in the results: return isActualVersion( es -> true, - os -> os.isLessThan( "2.16.0" ), + os -> !os.isMatching( "2.16.0" ), aoss -> false ); } diff --git a/integrationtest/showcase/library/src/test/java/org/hibernate/search/integrationtest/showcase/library/LibraryShowcaseSearchIT.java b/integrationtest/showcase/library/src/test/java/org/hibernate/search/integrationtest/showcase/library/LibraryShowcaseSearchIT.java index 73c36f5ad1b..e64e881cd1d 100644 --- a/integrationtest/showcase/library/src/test/java/org/hibernate/search/integrationtest/showcase/library/LibraryShowcaseSearchIT.java +++ b/integrationtest/showcase/library/src/test/java/org/hibernate/search/integrationtest/showcase/library/LibraryShowcaseSearchIT.java @@ -469,7 +469,7 @@ void searchFaceted() { || isActualVersion( es -> true, // See https://github.com/opensearch-project/OpenSearch/issues/15169 - os -> os.isLessThan( "2.16.0" ), + os -> !os.isMatching( "2.16.0" ), aoss -> false ) );