Skip to content

Commit

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



* Add Changelog



---------


(cherry picked from commit d83a2e8)

Signed-off-by: Vacha Shah <vachshah@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 044c2dc commit 5a9fa6b
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 @@ -17,9 +17,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Changed

### 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 5a9fa6b

Please sign in to comment.