issue #2528 - change interpretation of lt and gt for date searches #2531
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use the range interpretation of the search prefixes for both date and
number/quantity searches. The spec says:
lt
means "the range below the search value intersects (i.e. overlaps) with therange of the target value"
gt
means "the range above the search value intersects (i.e. overlaps) with therange of the target value"
For numbers, the spec additionally says:
Previously, we interpreted date search in the same way and so a search like
gt2016
would return any value above
2016-01-01 00:00:00
in the server'stimezone. However, we were not consistent with this because, for some reason,
we decided that
lt2016
should return any value below2017-01-01 00:00:00
.However, even if we properly implemented this "arbitrarily high precision" clause for date search,
this interpretation leads to confusing and unintuitive results like
gt2016
returning dates in 2016.Instead, we will now interpret the "search value" of 2016 to be the
range
[2016-01-01 00:00:00, 2017-01-01 00:00:00)
and therefor a search forgt2016
willonly find target values above 2017-01-01 00:00:00 (inclusive).
Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com