elasticsearch/elasticsearch — Issue #1708: Date Mapping: Support "date math" when searching
Author: kimchy
Created: 2012-02-16 16:09:06+00:00
State: open
Labels: feature, v0.19.0.RC3

Date math on `date` types allows to compose search values that include simple data math expressions.

The expression starts with an "anchor" date, which can be either `now` or a date string (in the applicable format) ending with `||`. It can then follow by a math expression, supporting `+`, `-` and `/` (rounding). The units supported are `M` (month), `w` (week), `h` (hour), `m` (minute), and `s` (second).

Here are some samples: `now+1h`, `now+1h+1m`, `now+1h/d`, `2012-01-01||+1M/d`.

Now, when doing `range` type searches, and the upper value is inclusive, the rounding will properly be rounded to the ceiling instead of flooring it.