-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Support coerce JSON -> String #19691
Comments
Right now that mapping above isn't considered valid. ES blows up with:
|
I am not a fan of this feature. Either we could make string fields automatically coerce objects to strings but this would be quite trappy in my opinion: I can certainly imagine users complaining that elasticsearch does not reject documents that do not comply with the mappings. Or we would need a mapping option to enable this behaviour like numerics have to automatically parse strings, but I don't like it either as we already have too many options on mappings. I would rather rely on clients to provide a string that contains escaped json. |
This is a duplicate of #17918 where we decided against doing it. |
Continuing conversation started here: https://discuss.elastic.co/t/coerce-object-to-string/56748/3
Description of the problem including expected versus actual behavior:
Would like to be able to treat an object field as String given the following mapping:
Indexing the following document:
should store the document under
metadata
as a searchable String.Right now, it is not possible to coerce anything to a String.
The text was updated successfully, but these errors were encountered: