You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should not include that last document. The lte parameter, when used with date rounding, should use ceil() to round the date up, as it does today, but include_upper should be set to false.
The text was updated successfully, but these errors were encountered:
Date math rounding currently works by rounding the date up or down based
on the scope of the rounding. For example, if you have the date
`2009-12-24||/d` it will round down to the inclusive lower end
`2009-12-24T00:00:00.000` and round up to the non-inclusive date
`2009-12-25T00:00:00.000`.
The range endpoint semantics work as follows:
gt - round D down, and use > that value
gte - round D down, and use >= that value
lt - round D down, and use <
lte - round D up, and use <=
There are 2 problems with these semantics:
1. lte ends up including the upper value, which should be non-inclusive
2. gt only excludes the beginning of the date, not the entire rounding scope
This change makes the range endpoint semantics symmetrical. First, it
changes the parser to round up and down using the first (same as before)
and last (1 ms less than before) values of the rounding scope. This
makes both rounded endpoints inclusive. The range endpoint semantics
are then as follows:
gt - round D up, and use > that value
gte - round D down, and use >= that value
lt - round D down, and use < that value
lte - round D up, and use <= that value
closeselastic#8424
Date math rounding currently works by rounding the date up or down based
on the scope of the rounding. For example, if you have the date
`2009-12-24||/d` it will round down to the inclusive lower end
`2009-12-24T00:00:00.000` and round up to the non-inclusive date
`2009-12-25T00:00:00.000`.
The range endpoint semantics work as follows:
* `gt` - round D down, and use > that value
* `gte` - round D down, and use >= that value
* `lt` - round D down, and use <
* `lte` - round D up, and use <=
There are 2 problems with these semantics:
* `lte` ends up including the upper value, which should be non-inclusive
* `gt` only excludes the beginning of the date, not the entire rounding scope
This change makes the range endpoint semantics symmetrical. First, it
changes the parser to round up and down using the first (same as before)
and last (1 ms less than before) values of the rounding scope. This
makes both rounded endpoints inclusive. The range endpoint semantics
are then as follows:
* `gt` - round D up, and use > that value
* `gte` - round D down, and use >= that value
* `lt` - round D down, and use < that value
* `lte` - round D up, and use <= that value
closes#8424closes#8556
As discussed in #7203 the current behaviour of
lt
/lte
with date rounding is inconsistent. For instance, with the following docs indexed:This query with
lt
:correctly returns
2014/11/07 00:00:00
and2014/11/07 01:00:00
, but this query withlte
:incorrectly returns:
2014/11/07 00:00:00
2014/11/07 01:00:00
2014/11/08 00:00:00
2014/11/08 01:00:00
2014/11/09 00:00:00
It should not include that last document. The
lte
parameter, when used with date rounding, should useceil()
to round the date up, as it does today, butinclude_upper
should be set tofalse
.The text was updated successfully, but these errors were encountered: