Skip to content

Aggegation: DateHistogram - interval should support enum value #981

@jayhilden

Description

@jayhilden

when doing an aggregation on DateHistogram that "interval" option only takes a string as an arguement, it would be very nice if it supported the DateInterval enum value the same way the facets do.

This is a working sample:

var result = ElasticClient
    .Search<AuthForReporting>(s => s
        .Size(0)
        .Aggregations(a => a.DateHistogram("AuthsByDate", t => t
            .Field(f => f.AuthResult.AuthEventDate)
            .Interval(DateInterval.Day.ToString().ToLower())
)));

It would be great if we could specify:

.Interval(DateInterval.Day)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions