Skip to content
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

SearchAsYouTypeProperty: Unknown field 'doc_values' (JSON path: mappings.properties.search_as_you_type.doc_values #935

Open
yeikel opened this issue Feb 11, 2025 · 3 comments
Labels
Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working

Comments

@yeikel
Copy link

yeikel commented Feb 11, 2025

Java API client version

8.17.0

Java version

17

Elasticsearch Version

8.13.2

Problem description

Given an index with properties

"search_as_you_type": {
        "type": "search_as_you_type",
        "analyzer": "default",
        "doc_values": false
      }

I am able to post it to the server from Kibana:

Image

But the client fails to post it:


[ERROR]   JsonpMapping Error deserializing co.elastic.clients.elasticsearch._types.mapping.SearchAsYouTypeProperty: Unknown field 'doc_values' (JSON path: mappings.properties.search_as_you_type.doc_values) (in object at line no=52, column no=30, offset=1208)

@l-trotta
Copy link
Contributor

Hello and thank you for reporting this. This is a special case, since search_as_you_type actually doesn't support doc_values as a request field, but the server always includes it as "false" in the response. I'll investigate a bit to understand how we want to handle this!

@l-trotta l-trotta added Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working labels Feb 11, 2025
@yeikel
Copy link
Author

yeikel commented Feb 11, 2025

Hello and thank you for reporting this. This is a special case, since search_as_you_type actually doesn't support doc_values as a request field, but the server always includes it as "false" in the response. I'll investigate a bit to understand how we want to handle this!

That's interesting because it allowed me to set it to false when I created the index, which gave me the illusion that it was possible to set it

If setting it shouldn't be possible, it should probably fail, I believe

Also, I think that the docs https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html should be updated to include this limitation as it currently says

Doc values are supported on almost all field types, with the notable exception of text and annotated_text fields.

@l-trotta
Copy link
Contributor

Good catch, if this is confirmed then we'll also update the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants