jillesvangurp/kt-search

[FEAT] Date format in date histogram aggregation

Closed this issue · 0 comments

Describe the enhancement

I'd like to be able to choose the date format in a DateHistogramAgg.

Why is this needed?

It's an ElasticSearch feature, so it should be in this lib as well.

How do you think it should be done?

The property format should be added to the DateHistogramAggConfig class, like so:

class DateHistogramAggConfig : JsonDsl() {
    var field by property<String>()
    var calendarInterval by property<String>("interval")
    var format by property<String>("format") // <--
    var minDocCount by property<Long>("min_doc_count")
}

Will you be able to help with a pull request?

Yes.