I am afraid that this might not be available in elasticsearch. You may need to analyze the answer. Consider
Distortions
One of the things that appeared in Apache Solr 4.0 and is not available in ElasticSearch is now the ability to convert result documents. First of all, Solr allows you to return aliases, so, for example, you can return the price_usd or price_eur field depending on your needs. Secondly, it is the ability to return the values returned by functions as a (pseudo) field in the result (or field). Solr also has the ability to return fields starting with a given prefix (for example, all fields starting with a price). In addition to the ability to get the value of the function as a field added to the agreed documents on the fly, other functions are not destroyed, although in some cases they can be convenient.
from http://blog.sematext.com/2012/10/01/solr-vs-elasticsearch-part-3-searching/