-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dates can't reference some esoteric but valid dates #9048
Comments
All I want for Christmas is BigDate? :) As you say, this is an esoteric use case. Probably not a good idea to mix up our existing At first I thought of having a |
Probably BigDate is a good thing to call it, yeah. So some points:
So we have this dichotomy - second precision would mostly be overkill from an error bars standpoint but not good from a total ordering standpoint. For that reason I think something like just stuffing it in a BigDecimal holding seconds is probably a good choice. It looks like its implemented as an arbitrary precision mantissa and a scale which seems like a reasonably efficient way to handle my dichotomy. I haven't checked how that'd play with Lucene or doc values or anything |
I think there are two issues here: sorting and range queries. Sorting would be quite easy if you manage to find an encoding scheme for your dates so that the lexicographical order of your encoded dates matches the numeric order of your dates. (You don't actually need a plugin for that, you could just do the encoding on client-side into a string field.) For range queries, we had a similar issue for ipv6 addresses and @mikemccand worked on a nice patch that automatically adds prefix terms so that range queries are fast: https://issues.apache.org/jira/browse/LUCENE-5879 but it raises a couple of design issues that have prevented it from being committed so far. |
At PANGAEA, where we also have dates going back to geological areas :) the best you can do is: Use Microweich Excel magic and encode dates as double: Full days since epoch. If you are close to epoch you have best precision, but you can still go back billions of years. Thi s works fine for sorting, and if the double value ×86,400,000 is in long range you can still use real date formatters. Otherwise just see it as days/years or what you like by scaling. I don't think you need support for this in ES, just convert your dates on client. |
++ @uschindler ! |
@nik9000 I'm curious whether this idea would address your needs? |
Assuming that this issue has been resolved. Feel free to reopen |
We're looking at providing some kind of structured search for wikidata.org. It contains dates like
And, try as I might, I can't use dates for them. I know I can still store them as longs containing seconds since epoch but that'll only work backwards. I can't find any dates hugely in the future on wikidata right now but wouldn't be surprised if I ended up with stuff like
I know these dates are really silly for handling log messages but they matter to me if no one else.
Is this something Elasticsearch should have builtin or should I go make another plugin?
The text was updated successfully, but these errors were encountered: