Closed
Bug 823060
Opened 13 years ago
Closed 13 years ago
[research] Use datetime instead of ints in ES mappings
Categories
(support.mozilla.org :: Code Quality, task, P2)
support.mozilla.org
Code Quality
Tracking
(Not tracked)
RESOLVED
FIXED
2013Q1
People
(Reporter: rrosario, Assigned: mythmon)
References
Details
(Whiteboard: u=dev c=search p=1 s=2013.1)
I found this TODO in the code:
# TODO: Sphinx stores created and updated as seconds since the
# epoch, so we convert them to that format here so that the
# search view works correctly. When we ditch Sphinx, we should
# see if it's faster to filter on ints or whether we should
# switch them to dates.
Let's either remove the TODO or come up with plan to do it if it makes sense
| Reporter | ||
Comment 1•13 years ago
|
||
Word on the street is that mythmon is the expert here.
Assignee: nobody → mcooper
| Reporter | ||
Comment 2•13 years ago
|
||
| Assignee | ||
Comment 3•13 years ago
|
||
To my knowledge, ES internally stores dates and datetimes as milliseconds since Jan 1st 1970. When communicating with ES, it accepts dates in various string formats, such as YYYY-MM-DD HH:MM:SS.MS. pyes and pyelasticsearch both handle the translation from python datetime objects to these strings, and back.
In Fjord, we just shoved datetime objects at ES, and it worked well, and we could use histograms. I think it would be beneficial to do the same thing here. It will likely enable better time based searching, and it's better to let someone else do the conversion, like pyes.
I have no idea how this would affect performance, but I think that having the right semantic type is a good thing. I think we should switch to using datetimes.
Sources:
https://github.com/aparo/pyes/blob/master/pyes/es.py#L67
https://github.com/rhec/pyelasticsearch/blob/master/pyelasticsearch/client.py#L825
https://github.com/mozilla/fjord/blob/master/fjord/feedback/models.py#L89
http://www.elasticsearch.org/guide/reference/mapping/date-format.html
| Reporter | ||
Comment 4•13 years ago
|
||
Thanks mythmon! Sounds like we just want to file a bug to convert to using proper datetimes and close this out.
| Assignee | ||
Comment 5•13 years ago
|
||
Filed implementation bug 828010.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•