Module org.elasticsearch.server
Class DateHistogramValuesSourceBuilder
java.lang.Object
org.elasticsearch.search.aggregations.bucket.composite.CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
org.elasticsearch.search.aggregations.bucket.composite.DateHistogramValuesSourceBuilder
- All Implemented Interfaces:
- Writeable,- DateIntervalConsumer<DateHistogramValuesSourceBuilder>,- ToXContent,- ToXContentFragment
public class DateHistogramValuesSourceBuilder
extends CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
implements DateIntervalConsumer<DateHistogramValuesSourceBuilder>
A 
CompositeValuesSourceBuilder that builds a RoundingValuesSource from a Script or
 a field name using the provided interval.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceNested 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 SummaryFields inherited from class org.elasticsearch.search.aggregations.bucket.composite.CompositeValuesSourceBuildernameFields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotected
- 
Method SummaryModifier and TypeMethodDescriptioncalendarInterval(DateHistogramInterval interval) Sets the interval of the DateHistogram using calendar units (`1d`, `1w`, `1M`, etc).protected voiddoXContentBody(XContentBuilder builder, ToXContent.Params params) booleanfixedInterval(DateHistogramInterval interval) Sets the interval of the DateHistogram using fixed units (`1ms`, `1s`, `10m`, `4h`, etc).protected ValuesSourceTypeReturn the interval as a date time unit if applicable, regardless of how it was configured.Get the interval as aTimeValue, regardless of how it was configured.inthashCode()protected CompositeValuesSourceConfiginnerBuild(ValuesSourceRegistry registry, ValuesSourceConfig config) Actually build the values source and its associated configuration.protected voidinnerWriteTo(StreamOutput out) longoffset()Get the offset to use when rounding, which is a number of milliseconds.offset(long offset) Set the offset on this builder, which is a number of milliseconds.static voidregister(ValuesSourceRegistry.Builder builder) timeZone()Gets the time zone to use for this aggregationSets the time zone to use for this aggregationtype()Methods inherited from class org.elasticsearch.search.aggregations.bucket.composite.CompositeValuesSourceBuilderbuild, field, field, format, format, missingBucket, missingBucket, missingOrder, missingOrder, missingOrder, name, order, order, order, script, script, toXContent, userValuetypeHint, userValuetypeHint, writeToMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragmentisFragment
- 
Constructor Details- 
DateHistogramValuesSourceBuilder
- 
DateHistogramValuesSourceBuilder- Throws:
- IOException
 
 
- 
- 
Method Details- 
innerWriteTo- Specified by:
- innerWriteToin class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
- Throws:
- IOException
 
- 
doXContentBody- Specified by:
- doXContentBodyin class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
- Throws:
- IOException
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
 
- 
equals- Overrides:
- equalsin class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
 
- 
type
- 
calendarIntervalSets the interval of the DateHistogram using calendar units (`1d`, `1w`, `1M`, etc). These units are calendar-aware, meaning they respect leap additions, variable days per month, etc. This is mutually exclusive withfixedInterval(DateHistogramInterval)- Specified by:
- calendarIntervalin interface- DateIntervalConsumer<DateHistogramValuesSourceBuilder>
- Parameters:
- interval- The calendar interval to use with the aggregation
 
- 
fixedIntervalSets the interval of the DateHistogram using fixed units (`1ms`, `1s`, `10m`, `4h`, etc). These are not calendar aware and are simply multiples of fixed, SI units. This is mutually exclusive withcalendarInterval(DateHistogramInterval)- Specified by:
- fixedIntervalin interface- DateIntervalConsumer<DateHistogramValuesSourceBuilder>
- Parameters:
- interval- The fixed interval to use with the aggregation
 
- 
getIntervalAsCalendarReturn the interval as a date time unit if applicable, regardless of how it was configured. If this returnsnullthen it means that the interval is expressed as a fixedTimeValueand may be accessed viagetIntervalAsFixed()()}.
- 
getIntervalAsFixedGet the interval as aTimeValue, regardless of how it was configured. Returns null if the interval cannot be parsed as a fixed time.
- 
timeZoneSets the time zone to use for this aggregation
- 
timeZoneGets the time zone to use for this aggregation- Overrides:
- timeZonein class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
 
- 
offsetpublic long offset()Get the offset to use when rounding, which is a number of milliseconds.
- 
offsetSet the offset on this builder, which is a number of milliseconds.- Returns:
- this for chaining
 
- 
register
- 
getDefaultValuesSourceType- Specified by:
- getDefaultValuesSourceTypein class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
 
- 
innerBuildprotected CompositeValuesSourceConfig innerBuild(ValuesSourceRegistry registry, ValuesSourceConfig config) throws IOException Description copied from class:CompositeValuesSourceBuilderActually build the values source and its associated configuration.- Specified by:
- innerBuildin class- CompositeValuesSourceBuilder<DateHistogramValuesSourceBuilder>
- Throws:
- IOException
 
 
-