Class DateHistogramInterval
org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public class DateHistogramInterval
extends
implements Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
The interval the date histogram is based on.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic DateHistogramInterval
static DateHistogramInterval
static DateHistogramInterval
static DateHistogramInterval
static DateHistogramInterval
static DateHistogramInterval
static DateHistogramInterval
static DateHistogramInterval
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateHistogramInterval
days(int days)
boolean
obj)
long
Converts this DateHistogramInterval into a millisecond representation.int
hashCode()
static DateHistogramInterval
hours(int hours)
static DateHistogramInterval
minutes(int min)
static DateHistogramInterval
seconds(int sec)
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
static DateHistogramInterval
weeks(int weeks)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.
, , , , , , ,
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
SECOND
-
MINUTE
-
HOUR
-
DAY
-
WEEK
-
MONTH
-
QUARTER
-
YEAR
-
-
Constructor Details
-
DateHistogramInterval
public DateHistogramInterval( expression) -
DateHistogramInterval
Read from a stream.- Throws:
-
-
Method Details
-
seconds
-
minutes
-
hours
-
days
-
weeks
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
toString
public toString()- Overrides:
in class
-
hashCode
public int hashCode()- Overrides:
in class
-
equals
public boolean equals( obj)- Overrides:
in class
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
-
estimateMillis
public long estimateMillis()Converts this DateHistogramInterval into a millisecond representation. If this is a calendar interval, it is an approximation of milliseconds based on the fixed equivalent (e.g. `1h` is treated as 60 fixed minutes, rather than the hour at a specific point in time. This is merely a convenience helper for quick comparisons and should not be used for situations that require precise durations.
-