Hi all

I'm trying to replace a use of the stats module with JSON facets in
order to calculate the min/max date range of documents in a query. For
the same search, "stats.field=date_published" returns this:

{u'date_published': {u'count': 86760,
                     u'max': u'2016-07-13T00:00:00Z',
                     u'mean': u'2013-12-11T07:09:17.676Z',
                     u'min': u'2011-01-04T00:00:00Z',
                     u'missing': 0,
                     u'stddev': 50006856043.410477,
                     u'sum': u'3814570-11-06T00:00:00Z',
                     u'sumOfSquares': 1.670619719649826e+29}}

For the equivalent JSON facet - "{'date.max': 'max(date_published)',
'date.min': 'min(date_published)'}" - I'm returned this:

{u'count': 86760, u'date.max': 1468368000000.0, u'date.min': 1294099200000.0}

What do these numbers represent - I'm guessing it is milliseconds
since epoch? In UTC?
Is there any way to control the output format or TZ?
Is there any benefit in using JSON facets to determine this, or should
I just continue using stats?

Cheers

Tom

Reply via email to