karmi / retire

A rich Ruby API and DSL for the Elasticsearch search engine
http://karmi.github.com/retire/
MIT License
1.86k stars 533 forks source link

Elasticsearch facets with user's local timezone #960

Open simonmorley opened 10 years ago

simonmorley commented 10 years ago

Facets are all returned with a UTC timestamp.

We hadn't noticed the problem until we overlay an ES facet series on top of a series generated with an Arel query. Our mistake.

We have a filter in our Application controller which converts to the user's localtime. This doesn't (obviously) work for ES. But I think it should for Tire.

To convert to localtime, I was intending on mapping each timestamp to the users localtime.

However, I was wondering if there a more sophisticated way to do this?