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

Removing unsupported prefix field from CompletionSuggester #812

Merged
merged 2 commits into from
Jan 19, 2024
Merged
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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}
*/
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -184,9 +167,6 @@ public static class Builder extends SuggesterBase.AbstractBuilder<Builder> imple
@Nullable
private SuggestFuzziness fuzzy;

@Nullable
private String prefix;

@Nullable
private String regex;

Expand Down Expand Up @@ -228,14 +208,6 @@ public final Builder fuzzy(Function<SuggestFuzziness.Builder, ObjectBuilder<Sugg
return this.fuzzy(fn.apply(new SuggestFuzziness.Builder()).build());
}

/**
* API name: {@code prefix}
*/
public final Builder prefix(@Nullable String value) {
this.prefix = value;
return this;
}

/**
* API name: {@code regex}
*/
Expand Down Expand Up @@ -288,7 +260,6 @@ protected static void setupCompletionSuggesterDeserializer(ObjectDeserializer<Co
"contexts"
);
op.add(Builder::fuzzy, SuggestFuzziness._DESERIALIZER, "fuzzy");
op.add(Builder::prefix, JsonpDeserializer.stringDeserializer(), "prefix");
op.add(Builder::regex, JsonpDeserializer.stringDeserializer(), "regex");
op.add(Builder::skipDuplicates, JsonpDeserializer.booleanDeserializer(), "skip_duplicates");

Expand Down
Loading