-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Allow default (dynamic) time for date mappings #7732
Comments
+1 |
it would also remove the need for the dedicated |
So I just had a look at how we might do this and thought of something relating to us doing dynamic null values for any type. The null_value is obviously used for when there is no supplied value so adding a dynamic value to index is relatively straight forward in this respect. However, the null_value is also used in AbstractFieldMapper.nullValueFilter() to generate a filter for the MissingFilter and here is where the question arises. We could say that if you set the null_value to be dynamic then the MissingFilter will essentially be a NoOP and not match any documents (since every document with a null value gets a dynamic value added and therefore doesn't have a missing value). This could cause issues in a system where, for example, you set your null_value to 'NO VALUE' and some of your documents come in with the field set to null and some with the field set to 'NO VALUE' (e.g. for different systems). At the moment we treat both these as the same in the MissingFilter (they will both have the null_value in the index and will be returned by the MissingFilter. But if we make the null_value dynamic then the 'NO VALUE' fields won't be returned by the filter add won't be dynamically given a value either. I can see two options to solve this:
|
Hmm, I agree..it conflates concerns and is confusing. How about this:
Both That would allow everyone to specify exactly what they want with no surprises. The two settings won't interact, since a field is either null or missing. It does break the case where a field was originally "missing" but made "not missing" by usage of |
Another thing to consider - if we generate a value for a date field, should it alter the |
With Maybe instead of adding confusion to This would update the stored field whenever the document is indexed. Another possible usecase might be to insert the timestamp only the FIRST time the document is indexed...which means if its set, dont update it on subsequent updates of the document. No idea how to name that...maybe |
@bobbyhubbard I think the way forward is by using the ingest node (#14049) when it gets available. Adding a timestamp to a document would look like this:
|
+1 |
Closing in favour of #14049 |
It would be convenient if the date field could be configured to provide a default time (likely
now()
). It would make sense if this was an extension tonull_value
which has specific, dynamic functionality for a date field.The text was updated successfully, but these errors were encountered: