Bug present trying to perform suggest query

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Version 2.4.1 of client library

Describe the issue:

I am getting an error using the OpenSearch client, but when I serialize and run the query directly against the cluster, the query works as expected.

I wonder if this bug still exists that was fixed in the ElasticSearch client: client failed to parse completion suggest response · Issue #57 · elastic/elasticsearch-java · GitHub


String suggestionField = "prefix";
int size = 5;

Map<String, FieldSuggester> fieldSuggesters = new HashMap<>();
for (String suggestionField: getSuggestionQueryFields()) {
    CompletionSuggester completionSuggester = FieldSuggesterBuilders.completion()
    FieldSuggester fieldSuggester = new FieldSuggester.Builder()

    fieldSuggesters.put(suggestionField + "Suggestion", fieldSuggester);

Suggester suggester = new Suggester.Builder()
SearchRequest searchRequest = new SearchRequest.Builder()

if (LOGGER.isDebugEnabled()) {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    JacksonJsonpGenerator generator = new JacksonJsonpGenerator(
            new JsonFactory().createGenerator(outputStream));
            new JacksonJsonpMapper());

    String query = outputStream.toString();

SearchResponse<MyType> response = this.openSearchClient.search(searchRequest, MyType.class);

Relevant Logs or Screenshots:

The following exception is being thrown (I believe incorrectly, since I am doing completion and not term suggestion):
org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'TermSuggestOption.score'

Hello @hartd - is this what you’re seeing? If so, looks like it may still be something the team is working to resolve: