-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Hello,
In the latest NEST (5.5) and Elasticsearch (5.5):
Trying to use TimeUnit as in the code below:
.ExponentialDate(gd => gd
.Field("update_date")
.Origin(DateMath.Now)
.Offset(TimeSpan.FromDays(60))
Offset expects Time type.
When I specify Offset("60d") above the query works fine, as "d" is supported by Elasticsearch.
When I specify Offset(TimeSpan.FromDays(60)), NEST transforms that to the following JSON:
"exp": {
"update_date": {
"origin": "now",
"scale": "8.57142857142857w"
and as soon as "w" (week) seems like not supported for TimeUnits the exception is thrown.
Supported TimeUnits:
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/common-options.html#time-units
NEST Time:
https://www.elastic.co/guide/en/elasticsearch/client/net-api/5.x/time-units.html
Please update, thank you!
Metadata
Metadata
Assignees
Labels
No labels