Skip to content

Commit

Permalink
Removing unsupported prefix field from CompletionSuggester (#812)
Browse files Browse the repository at this point in the history
* Removing unsupported prefix field from CompletionSuggester

Signed-off-by: Vacha Shah <[email protected]>

* Add Changelog

Signed-off-by: Vacha Shah <[email protected]>

---------

Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah authored Jan 19, 2024
1 parent 550dd4b commit d83a2e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
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

0 comments on commit d83a2e8

Please sign in to comment.