How to apply a date format to results from a query for date fields

Lets say that a date is stored in a format such that the result comes back
in JSON as:
{
startDate: 959904000000
}

Is there any way to specify a transformation to a date format like YEAR in
the query itself?
Sp that the result coming back which may be stored on ES as 959904000000
... will be shown in the returned JSON as the year 2005?

You mean you index it as startDate: 959904000000? You could install use a
script field to get hte value and munge it how you like
Elasticsearch Platform — Find real-time answers at scale | Elastic.

On Sun, Apr 15, 2012 at 5:26 AM, pulkitsinghal pulkitsinghal@gmail.comwrote:

Lets say that a date is stored in a format such that the result comes back
in JSON as:
{
startDate: 959904000000
}

Is there any way to specify a transformation to a date format like YEAR in
the query itself?
Sp that the result coming back which may be stored on ES as 959904000000
... will be shown in the returned JSON as the year 2005?