Esempio n. 1
0
        /// <summary>
        /// Creates a date histogram facet based on a field and constant interval.
        /// </summary>
        /// <param name="facetName">Sets the name for the facet.</param>
        /// <param name="field">Sets the field value.</param>
        /// <param name="constantInterval">Sets the constant interval to use.</param>
        public DateHistogramFacet(string facetName, string field, DateIntervalEnum constantInterval)
            : this(facetName, constantInterval)
        {
            if (string.IsNullOrWhiteSpace(field))
                throw new ArgumentNullException("field", "DateHistogramFacet requires a field value.");

            Field = field;
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a date histogram facet using a constant interval that expects key/value field or script to be populated.
        /// </summary>
        /// <param name="facetName">Sets the name of the facet.</param>
        /// <param name="constantInterval">Sets the constant interval.</param>
        public DateHistogramFacet(string facetName, DateIntervalEnum constantInterval)
            : base(facetName)
        {
            if (constantInterval == null)
                throw new ArgumentNullException("constantInterval", "DateHistogramFacet requires a constantInterval.");

            ConstantInterval = constantInterval;
            PreZoneAdjustLargeInterval = DateHistogramSerializer._PRE_ZONE_ADJUST_LARGE_INTERVAL_DEFAULT;
        }
 /// <summary>
 /// Creates a date histogram facet based on a field and constant interval.
 /// </summary>
 /// <param name="facetName">Sets the name for the facet.</param>
 /// <param name="field">Sets the field value.</param>
 /// <param name="script">Sets the script value.</param>
 /// <param name="constantInterval">Sets the constant interval to use.</param>
 public DateHistogramAggregate(string facetName, string field, Script script, DateIntervalEnum constantInterval)
     : this(facetName, constantInterval)
 {
     if (string.IsNullOrWhiteSpace(field))
         throw new ArgumentNullException("field", "DateHistogramAggregate requires a field value.");
     if (script == null)
         throw new ArgumentNullException("script", "DateHistogramAggregate requires a script value.");
     Field = field;
     Script = script;
 }
 /// <summary>
 /// Creates a date histogram facet based on a field and constant interval.
 /// </summary>
 /// <param name="facetName">Sets the name for the facet.</param>
 /// <param name="script">Sets the script value.</param>
 /// <param name="constantInterval">Sets the constant interval to use.</param>
 public DateHistogramAggregate(string facetName, Script script, DateIntervalEnum constantInterval)
     : this(facetName, constantInterval)
 {
     if (script == null)
         throw new ArgumentNullException("script", "DateHistogramAggregate requires a script value.");
     Script = script;
 }
        /// <summary>
        /// Creates a date histogram facet using a constant interval that expects key/value field or script to be populated.
        /// </summary>
        /// <param name="facetName">Sets the name of the facet.</param>
        /// <param name="constantInterval">Sets the constant interval.</param>
        private DateHistogramAggregate(string facetName, DateIntervalEnum constantInterval)
            : base(facetName)
        {
            if (constantInterval == null)
                throw new ArgumentNullException("constantInterval", "DateHistogramAggregate requires a constantInterval.");

            ConstantInterval = constantInterval;
            PreZoneAdjustLargeInterval = DateHistogramSerializer._PRE_ZONE_ADJUST_LARGE_INTERVAL_DEFAULT;
            PreZone = DateHistogramSerializer._TIMESPAN_DEFAULT;
            PostZone = DateHistogramSerializer._TIMESPAN_DEFAULT;
            TimeZone = DateHistogramSerializer._TIMESPAN_DEFAULT;
            MinimumDocumentCount = DateHistogramSerializer._MINIMUM_DOCUMENT_COUNT_DEFAULT;
        }