-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Consolidate _timestamp and _ttl into _expiration #9679
Comments
Oh, and I forgot the most important setting: |
I think this is missing the case where users would like an automated timestamp representing |
This sounds good to me. I think it's important to have as few root mappers as necessary and to lock them down as much as we can. This makes me wonder if we actually need settings besides |
@clintongormley A meta field doesn't seem like the right place to have that functionality? It seems like having a date field with null value of @jpountz I think having |
@rjernst if it is not a meta field, then the only place to store it would be in the |
I don't think this should keep us in the "business" of maintaining a system _timestamp field. Why do we do this? It just makes the system complicated. Just let users configure their own date fields. If we need a fieldtype that can 'set itself from NOW' for esoteric cases, why can't that be a separate one, maybe even a plugin. we can't let the 1% screw over the 99% |
Also, having a single auto generated timestamp field is very limited. What if you want auto NOW at doc creation, and another field for doc updated? This is typical in dbs, and it seems silly to limit to just one of those, if we are to support it (which we maybe should, but as part of date fields, not a special meta field). |
New proposal: Remove the
|
Related discussion from a while back: #7732 Co-opting If |
I vote for being able to have generated datetime values inside the doc['_source'] One should have the ability to simulate created_at and updated_at values. I don't want to have change or specify anything from the application. Not sure what the sanest way would be to specify it.. something like:
seems inexact to say "value" : "now"... |
We discussed this issue in fixit friday and said that regardless of the way we plan to refactor _ttl, moving the functionality to a plugin would be great. |
Making it an adoptme: let's move it to a plugin first and then think about how to improve it. |
Actually this looks challenging: |
Closing in favour of #18280 |
Currently, the only purpose of the
_timestamp
field is to allow using a time other thanNOW
for use with_ttl
. In #9058 we are working on simplifying where the explicit timestamp is specified.I propose we actually have a single field,
_expiration
, which takes the behavior of both. Internally,_ttl
already indexes the actual expiration time, so that it can be queried later to do the deletes._expiration
would be a much better and direct name for this field, and can have the following settings:The parameters for indexing could then be
expiration
which is an explicit datetime to expire, orttl
which has the same behavior as today. One and only one of these parameters would be allowed, and one would be required if the required flag was set.The text was updated successfully, but these errors were encountered: