Hello,
I am looking for a way to have a query that returns the name of field differently. Like SQL's " SELECT column_name AS alias_name". Feel like there would be an easier solution but only I can think of is using a script to achieve this. For example,
"script_fields" : {
"alias_name" : {
"script" : {
"source" : "doc['column_name'].value",
"lang" : "painless"
}
And outcome,
"_source":{
"column_other1": "value1",
"column_other2":"value2",
.....
},
"fields":{
"alias_name":[
"value"
Is there a better solution than this? I concern performance using the script.
Thanks in advance,