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
Description of the problem including expected versus actual behavior:
Converting from 6.x to 7, using NEST.7xUpgradeAssistant (really helpful btw!)
When changing code from .Interval(DateInterval.Day)
the comment on the Obsolete attribute implies that the equivalent call should be .FixedInterval(DateInterval.Day)
but this seems to produce an invalid request? (showing only the aggs fragment): "aggs": {"doccountbyday": {"date_histogram": {"field": "published","fixed_interval": "day"}}}
The Reason is failed to parse setting [date_histogram.fixedInterval] with value [day] as a time value: unit is missing or unrecognized
I've figured out that the new code should be .FixedInterval(new Time(1, TimeUnit.Day))
which does produce a valid request: {"aggs":{"doccountbyday":{"date_histogram":{"field":"published","fixed_interval":"1d"}}}
Expected behavior
Either remove FixedInterval(DateInterval interval) - it's not a breaking change if it's already broken?!
or perform the conversion from DateInterval to Time within the method?