From 955ee715377b926d6c7ba915da82bb3050f6f91f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 08:37:49 -0500 Subject: [PATCH 1/4] Bump com.diffplug.spotless from 6.23.3 to 6.24.0 (#808) * Bump com.diffplug.spotless from 6.23.3 to 6.24.0 Bumps com.diffplug.spotless from 6.23.3 to 6.24.0. --- updated-dependencies: - dependency-name: com.diffplug.spotless dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- CHANGELOG.md | 2 +- java-client/build.gradle.kts | 2 +- samples/build.gradle.kts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e1cc6e49..38cae4401b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Dependencies - Bumps `io.github.classgraph:classgraph` from 4.8.163 to 4.8.165 - Bumps `org.owasp.dependencycheck` from 8.4.2 to 9.0.8 -- Bumps `com.diffplug.spotless` from 6.22.0 to 6.23.3 +- Bumps `com.diffplug.spotless` from 6.22.0 to 6.24.0 - Bumps `org.apache.httpcomponents.core5:httpcore5-h2` from 5.2.3 to 5.2.4 - Bumps `org.apache.httpcomponents.client5:httpclient5` from 5.2.1 to 5.3 - Bumps `org.apache.httpcomponents.core5:httpcore5` from 5.2.3 to 5.2.4 diff --git a/java-client/build.gradle.kts b/java-client/build.gradle.kts index d0b6065e2b..b63d957b4f 100644 --- a/java-client/build.gradle.kts +++ b/java-client/build.gradle.kts @@ -53,7 +53,7 @@ plugins { `maven-publish` id("com.github.jk1.dependency-license-report") version "2.5" id("org.owasp.dependencycheck") version "9.0.8" - id("com.diffplug.spotless") version "6.23.3" + id("com.diffplug.spotless") version "6.24.0" } apply(plugin = "opensearch.repositories") apply(plugin = "org.owasp.dependencycheck") diff --git a/samples/build.gradle.kts b/samples/build.gradle.kts index 59351ac9ae..798bf6bd39 100644 --- a/samples/build.gradle.kts +++ b/samples/build.gradle.kts @@ -9,7 +9,7 @@ plugins { java application - id("com.diffplug.spotless") version "6.23.3" + id("com.diffplug.spotless") version "6.24.0" } java { From 550dd4b1e523d4d5d0d1c03104ace317dda4ccb9 Mon Sep 17 00:00:00 2001 From: Urs Keller Date: Thu, 18 Jan 2024 19:52:45 +0100 Subject: [PATCH 2/4] Add wrapper to builder (#806) Signed-off-by: Urs Keller Co-authored-by: Urs Keller --- CHANGELOG.md | 2 ++ .../opensearch/_types/query_dsl/Query.java | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38cae4401b..05399e20bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ This section is for maintaining a changelog for all breaking changes for the cli ### Added - Document HTTP/2 support ([#330](https://github.com/opensearch-project/opensearch-java/pull/330)) - Expose HTTP status code through `ResponseException#status` ([#756](https://github.com/opensearch-project/opensearch-java/pull/756)) +- Added missing WrapperQuery accessors and builder methods ([#806](https://github.com/opensearch-project/opensearch-java/pull/806)) + ### Dependencies diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java index 0890341a86..6167d02d3d 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java @@ -1153,6 +1153,23 @@ public WildcardQuery wildcard() { return TaggedUnionUtils.get(this, Kind.Wildcard); } + /** + * Is this variant instance of kind {@code wrapper}? + */ + public boolean isWrapper() { + return this._kind == Query.Kind.Wrapper; + } + + /** + * Get the {@code wrapper} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code wrapper} kind. + */ + public WrapperQuery wrapper() { + return (WrapperQuery) TaggedUnionUtils.get(this, Query.Kind.Wrapper); + } + /** * Is this variant instance of kind {@code type}? */ @@ -1743,6 +1760,16 @@ public ObjectBuilder wildcard(Function wrapper(WrapperQuery v) { + this._kind = Query.Kind.Wrapper; + this._value = v; + return this; + } + + public ObjectBuilder wrapper(Function> fn) { + return this.wrapper(fn.apply(new WrapperQuery.Builder()).build()); + } + public ObjectBuilder type(TypeQuery v) { this._kind = Kind.Type; this._value = v; From d83a2e804a39f3a9e21eb29ffe6a01f1b1533871 Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Thu, 18 Jan 2024 16:24:54 -0800 Subject: [PATCH 3/4] Removing unsupported prefix field from CompletionSuggester (#812) * Removing unsupported prefix field from CompletionSuggester Signed-off-by: Vacha Shah * Add Changelog Signed-off-by: Vacha Shah --------- Signed-off-by: Vacha Shah --- CHANGELOG.md | 3 +- .../core/search/CompletionSuggester.java | 29 ------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05399e20bd..00bbe2ceec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,9 +54,10 @@ This section is for maintaining a changelog for all breaking changes for the cli - Add an integration test that runs on JDK-8 ([#795](https://github.com/opensearch-project/opensearch-java/pull/795)) ### Deprecated -- Deprecated "_toQuery()" in Query and QueryVariant ([#760](https://github.com/opensearch-project/opensearch-java/pull/760) +- Deprecated "_toQuery()" in Query and QueryVariant ([#760](https://github.com/opensearch-project/opensearch-java/pull/760)) ### Removed +- Removed unsupported `prefix` field from CompletionSuggester ([#812](https://github.com/opensearch-project/opensearch-java/pull/812)) ### Fixed - Fix partial success results for msearch_template ([#709](https://github.com/opensearch-project/opensearch-java/pull/709)) diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/core/search/CompletionSuggester.java b/java-client/src/main/java/org/opensearch/client/opensearch/core/search/CompletionSuggester.java index 42a7ba1280..8bba13b7f9 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/core/search/CompletionSuggester.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/core/search/CompletionSuggester.java @@ -54,9 +54,6 @@ public class CompletionSuggester extends SuggesterBase implements FieldSuggester @Nullable private final SuggestFuzziness fuzzy; - @Nullable - private final String prefix; - @Nullable private final String regex; @@ -70,7 +67,6 @@ private CompletionSuggester(Builder builder) { this.contexts = ApiTypeHelper.unmodifiable(builder.contexts); this.fuzzy = builder.fuzzy; - this.prefix = builder.prefix; this.regex = builder.regex; this.skipDuplicates = builder.skipDuplicates; @@ -103,14 +99,6 @@ public final SuggestFuzziness fuzzy() { return this.fuzzy; } - /** - * API name: {@code prefix} - */ - @Nullable - public final String prefix() { - return this.prefix; - } - /** * API name: {@code regex} */ @@ -152,11 +140,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("fuzzy"); this.fuzzy.serialize(generator, mapper); - } - if (this.prefix != null) { - generator.writeKey("prefix"); - generator.write(this.prefix); - } if (this.regex != null) { generator.writeKey("regex"); @@ -184,9 +167,6 @@ public static class Builder extends SuggesterBase.AbstractBuilder imple @Nullable private SuggestFuzziness fuzzy; - @Nullable - private String prefix; - @Nullable private String regex; @@ -228,14 +208,6 @@ public final Builder fuzzy(Function Date: Thu, 18 Jan 2024 19:31:20 -0800 Subject: [PATCH 4/4] Adding OpenSearch 2.11.0 to the matrix (#814) * Adding OpenSearch 2.11.0 to the matrix Signed-off-by: Vacha Shah * Updating version Signed-off-by: Vacha Shah --------- Signed-off-by: Vacha Shah --- .github/workflows/test-integration.yml | 1 + COMPATIBILITY.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 2961130bdf..9308fb7078 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -24,6 +24,7 @@ jobs: - { opensearch_version: 2.8.0, java: 11 } - { opensearch_version: 2.9.0, java: 11 } - { opensearch_version: 2.10.0, java: 11 } + - { opensearch_version: 2.11.1, java: 11 } steps: - name: Checkout Java Client uses: actions/checkout@v3 diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index bdab6cc899..c1b6fca51d 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -9,7 +9,7 @@ The below matrix shows the compatibility of the [`opensearch-java-client`](https | Client Version | OpenSearch Version | |----------------|--------------------| | 1.0.0 | 1.x | -| 2.x.0 | 1.3.13-2.10.0 | +| 2.x.0 | 1.3.13-2.x.x | ## Compatibility with JDK