summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php102
1 files changed, 75 insertions, 27 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php b/vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php
index 889fa429..8636f34c 100644
--- a/vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php
+++ b/vendor/ruflin/elastica/lib/Elastica/Aggregation/DateHistogram.php
@@ -1,82 +1,130 @@
<?php
-
namespace Elastica\Aggregation;
/**
- * Class DateHistogram
- * @package Elastica\Aggregation
- * @link http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-bucket-datehistogram-aggregation.html
+ * Class DateHistogram.
+ *
+ * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html
*/
class DateHistogram extends Histogram
{
/**
- * Set pre-rounding based on interval
+ * Set pre-rounding based on interval.
+ *
+ * @deprecated Option "pre_zone" is deprecated as of ES 1.5. Use "time_zone" instead
+ *
* @param string $preZone
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setPreZone($preZone)
{
- return $this->setParam("pre_zone", $preZone);
+ return $this->setParam('pre_zone', $preZone);
}
/**
- * Set post-rounding based on interval
+ * Set post-rounding based on interval.
+ *
+ * @deprecated Option "post_zone" is deprecated as of ES 1.5. Use "time_zone" instead
+ *
* @param string $postZone
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setPostZone($postZone)
{
- return $this->setParam("post_zone", $postZone);
+ return $this->setParam('post_zone', $postZone);
+ }
+
+ /**
+ * Set time_zone option.
+ *
+ * @param string
+ *
+ * @return $this
+ */
+ public function setTimezone($timezone)
+ {
+ return $this->setParam('time_zone', $timezone);
}
/**
- * Set pre-zone adjustment for larger time intervals (day and above)
+ * Set pre-zone adjustment for larger time intervals (day and above).
+ *
+ * @deprecated Option "pre_zone_adjust_large_interval" is deprecated as of ES 1.5
+ *
* @param string $adjust
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setPreZoneAdjustLargeInterval($adjust)
{
- return $this->setParam("pre_zone_adjust_large_interval", $adjust);
+ return $this->setParam('pre_zone_adjust_large_interval', $adjust);
}
/**
- * Adjust for granularity of date data
+ * Adjust for granularity of date data.
+ *
* @param int $factor set to 1000 if date is stored in seconds rather than milliseconds
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setFactor($factor)
{
- return $this->setParam("factor", $factor);
+ return $this->setParam('factor', $factor);
}
/**
- * Set the offset for pre-rounding
+ * Set the offset for pre-rounding.
+ *
+ * @deprecated Option "pre_offset" is deprecated as of ES 1.5. Use "offset" instead
+ *
* @param string $offset "1d", for example
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setPreOffset($offset)
{
- return $this->setParam("pre_offset", $offset);
+ return $this->setParam('pre_offset', $offset);
}
/**
- * Set the offset for post-rounding
+ * Set the offset for post-rounding.
+ *
+ * @deprecated Option "post_offset" is deprecated as of ES 1.5. Use "offset" instead
+ *
* @param string $offset "1d", for example
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setPostOffset($offset)
{
- return $this->setParam("post_offset", $offset);
+ return $this->setParam('post_offset', $offset);
+ }
+
+ /**
+ * Set offset option.
+ *
+ * @param string
+ *
+ * @return $this
+ */
+ public function setOffset($offset)
+ {
+ return $this->setParam('offset', $offset);
}
/**
- * Set the format for returned bucket key_as_string values
- * @link http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern
+ * Set the format for returned bucket key_as_string values.
+ *
+ * @link http://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern
+ *
* @param string $format see link for formatting options
- * @return DateHistogram
+ *
+ * @return $this
*/
public function setFormat($format)
{
- return $this->setParam("format", $format);
+ return $this->setParam('format', $format);
}
-} \ No newline at end of file
+}