Module org.elasticsearch.server
Class DateHistogramInterval
java.lang.Object
org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval
- All Implemented Interfaces:
- Writeable,- ToXContent,- ToXContentFragment
The interval the date histogram is based on.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContentToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final DateHistogramIntervalstatic final DateHistogramIntervalstatic final DateHistogramIntervalstatic final DateHistogramIntervalstatic final DateHistogramIntervalstatic final DateHistogramIntervalstatic final DateHistogramIntervalstatic final DateHistogramIntervalFields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic DateHistogramIntervaldays(int days) booleanlongConverts this DateHistogramInterval into a millisecond representation.inthashCode()static DateHistogramIntervalhours(int hours) static DateHistogramIntervalminutes(int min) static DateHistogramIntervalseconds(int sec) toString()toXContent(XContentBuilder builder, ToXContent.Params params) static DateHistogramIntervalweeks(int weeks) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragmentisFragment
- 
Field Details- 
SECOND
- 
MINUTE
- 
HOUR
- 
DAY
- 
WEEK
- 
MONTH
- 
QUARTER
- 
YEAR
 
- 
- 
Constructor Details- 
DateHistogramInterval
- 
DateHistogramIntervalRead from a stream.- Throws:
- IOException
 
 
- 
- 
Method Details- 
seconds
- 
minutes
- 
hours
- 
days
- 
weeks
- 
writeToDescription copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
- writeToin interface- Writeable
- Throws:
- IOException
 
- 
toString
- 
hashCodepublic int hashCode()
- 
equals
- 
toXContentpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
- toXContentin interface- ToXContent
- Throws:
- IOException
 
- 
estimateMillispublic 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.
 
-