mozilla / elasticutils

[deprecated] A friendly chainable ElasticSearch interface for python
http://elasticutils.rtfd.org
BSD 3-Clause "New" or "Revised" License
243 stars 76 forks source link

How can I query time range #268

Open MassD opened 9 years ago

MassD commented 9 years ago

Hi

I have a field named log_time, it is a standard datetime field, like 2014-10-06 10:06:07.405.

I tried s.query(log_time__range=(start_dt, end_dt)), but it seems never got anything back.

start_dt and end_dt are python datetime type.

I also transformed them to string, and try again, still no luck.

What is the proper way to query a datetime range?