We have a need to modify the response document(s) from a query before returning it to the user.
For example, we might need to rename a document field to a more user-friendly name.
I understand that elasticsearch has extensions or other means of doing this. So if anyone can point me in the right direction, i would greatly appreciate it.
Thank you for your reply. Much appreciate it.
I’m sorry but I must not be getting it, because when I read the docs in painless APIs it seems to work for values of fields VS actual field names...but the Painless APIs might be the right answer and I am not getting it.
Can you confirm how I can change the field name in a source doc, say from “random_field_name” to “friendly_field_name”
Thanks
if i am understand your, this script will be added to the _search endpoint and it will ADD new scripted field in the response, called "friendly_field_name" but the old field "random_field_name" will still be there too?
If that is true, is there a way just to rename the field with a script without adding a new field?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.