From d83a2e804a39f3a9e21eb29ffe6a01f1b1533871 Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Thu, 18 Jan 2024 16:24:54 -0800 Subject: [PATCH] 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