Skip to content

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

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

Closed
sergey-tihon opened this issue Apr 28, 2025 · 3 comments · Fixed by #8505
Closed

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

sergey-tihon opened this issue Apr 28, 2025 · 3 comments · Fixed by #8505
Labels
8.x Relates to a 8.x client version Category: Bug

Comments

@sergey-tihon
Copy link
Contributor

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.

@sergey-tihon sergey-tihon added 8.x Relates to a 8.x client version Category: Bug labels Apr 28, 2025
@flobernd
Copy link
Member

Hi @sergey-tihon, thanks for reporting. Just to clarify. Did that work in ES (server) 8.x?

It seems that either the specification is incorrect or the server behavior has changed and somebody forgot to update the specification as well.

@sergey-tihon
Copy link
Contributor Author

We did not have this issue before because Elastic.Clients.Elasticsearch 8.17.4 serialized fields as array.

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

I only have access to the cluster with ES (server) 8.18.0 and it behaves in the same way:

  • work when serialized as array
  • reply with[inner_hits] fields doesn't support values of type: VALUE_STRING error when serialized as string

@flobernd
Copy link
Member

Thanks for confirming @sergey-tihon, this definitely is a bug in the specification (it should be Field[] instead of Fields).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version Category: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants