Rename fields in the search output

Is there a way to rename the fields in the output similar to how you can do field aliases in SQL, e.g.: "SELECT lastname AS surname FROM people" ? Note, I want only the output be changed, not the stored fields or any mapping.

Well as a mater of fact you can use SQL syntax and do exactly that

See Here

@stephenb, any chance I can achieve that with DSL? I do not want to use x-pack :))

SQL is part of the Basic / default / free distribution (i.e if you just downloaded the normal version it is there) yes docs say xpack in this case just means not the in the OSS version but I also understand if you want to use the pure OSS version.

https://www.elastic.co/subscriptions

I do not believe there is simple way to do this you could create field alias or do at the application level.