Skip to content

9.0.0 - [inner_hits] fields doesn't support values of type: VALUE_STRING #8503

Closed
@sergey-tihon

Description

@sergey-tihon

Elastic.Clients.Elasticsearch version: 9.0.0

Elasticsearch version: 9.0.0

.NET runtime version: 9.0.4

Operating system version: macOS

Description of the problem including expected versus actual behavior:

Incorrect query serialization for inner_hits.fields.
According to spec it can be just string (not an array): https://github.com/elastic/elasticsearch-specification/blob/main/specification/_types/common.ts#L137

but elastic reply with error [inner_hits] fields doesn't support values of type: VALUE_STRING when fields serialized as string instead of arrray.

Steps to reproduce:

Execute query with fields serialized as string

"inner_hits": {
   "fields": "passages.text",
   "name": "elser-chunk",
   "size": 1,
   "_source": false
},

Expected behavior

Server should not return an error in this case, or serializer should always serialize fields as array. Following example work as expected:

"inner_hits": {
   "fields": ["passages.text"],
   "name": "elser-chunk",
   "size": 1,
   "_source": false
},

Provide DebugInformation (if relevant):

Image

Image

// cc @flobernd please take a look, it looks like a significant regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions