/** * Inner aggregations container init. * * @param string $name * @param string $field * @param int $sigma * @param string $script */ public function __construct($name, $field = null, $sigma = null, $script = null) { parent::__construct($name); $this->setField($field); $this->setSigma($sigma); $this->setScript($script); }
/** * Constructor for top hits. * * @param string $name Aggregation name. * @param null|int $size Number of top matching hits to return per bucket. * @param null|int $from The offset from the first result you want to fetch. * @param null|Sorts $sort How the top matching hits should be sorted. */ public function __construct($name, $size = null, $from = null, $sort = null) { parent::__construct($name); $this->setFrom($from); $this->setSize($size); $this->setSort($sort); }
/** * Inner aggregations container init. * * @param string $name * @param BuilderInterface $filter */ public function __construct($name, BuilderInterface $filter = null) { parent::__construct($name); if ($filter !== null) { $this->setFilter($filter); } }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param array $values * @param string $script * @param int $compression */ public function __construct($name, $field = null, $values = null, $script = null, $compression = null) { parent::__construct($name); $this->setField($field); $this->setValues($values); $this->setScript($script); $this->setCompression($compression); }
/** * ScriptedMetricAggregation constructor. * @param string $name * @param mixed $initScript * @param mixed $mapScript * @param mixed $combineScript * @param mixed $reduceScript */ public function __construct($name, $initScript = null, $mapScript = null, $combineScript = null, $reduceScript = null) { parent::__construct($name); $this->setInitScript($initScript); $this->setMapScript($mapScript); $this->setCombineScript($combineScript); $this->setReduceScript($reduceScript); }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param int $precision * @param int $size * @param int $shardSize */ public function __construct($name, $field = null, $precision = null, $size = null, $shardSize = null) { parent::__construct($name); $this->setField($field); $this->setPrecision($precision); $this->setSize($size); $this->setShardSize($shardSize); }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param int $interval * @param int $minDocCount * @param string $orderMode * @param string $orderDirection * @param int $extendedBoundsMin * @param int $extendedBoundsMax * @param bool $keyed */ public function __construct($name, $field = null, $interval = null, $minDocCount = null, $orderMode = null, $orderDirection = self::DIRECTION_ASC, $extendedBoundsMin = null, $extendedBoundsMax = null, $keyed = null) { parent::__construct($name); $this->setField($field); $this->setInterval($interval); $this->setMinDocCount($minDocCount); $this->setOrder($orderMode, $orderDirection); $this->setExtendedBounds($extendedBoundsMin, $extendedBoundsMax); $this->setKeyed($keyed); }
/** * @param string $name * @param string $field * @param string $format * @param array $ranges */ public function __construct($name, $field = null, $format = null, array $ranges = []) { parent::__construct($name); $this->setField($field); $this->setFormat($format); foreach ($ranges as $range) { $from = isset($range['from']) ? $range['from'] : null; $to = isset($range['to']) ? $range['to'] : null; $this->addRange($from, $to); } }
/** * Inner aggregations container init. * * @param string $name * @param BuilderInterface[] $filters * @param bool $anonymous */ public function __construct($name, $filters = [], $anonymous = false) { parent::__construct($name); $this->setAnonymous($anonymous); foreach ($filters as $name => $filter) { if ($anonymous) { $this->addFilter($filter); } else { $this->addFilter($filter, $name); } } }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param array $ranges * @param bool $keyed */ public function __construct($name, $field = null, $ranges = [], $keyed = false) { parent::__construct($name); $this->setField($field); $this->setKeyed($keyed); foreach ($ranges as $range) { $from = isset($range['from']) ? $range['from'] : null; $to = isset($range['to']) ? $range['to'] : null; $key = isset($range['key']) ? $range['key'] : null; $this->addRange($from, $to, $key); } }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param mixed $origin * @param array $ranges * @param string $unit * @param string $distanceType */ public function __construct($name, $field = null, $origin = null, $ranges = [], $unit = null, $distanceType = null) { parent::__construct($name); $this->setField($field); $this->setOrigin($origin); foreach ($ranges as $range) { $from = isset($range['from']) ? $range['from'] : null; $to = isset($range['to']) ? $range['to'] : null; $this->addRange($from, $to); } $this->setUnit($unit); $this->setDistanceType($distanceType); }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param array $ranges */ public function __construct($name, $field = null, $ranges = []) { parent::__construct($name); $this->setField($field); foreach ($ranges as $range) { if (is_array($range)) { $from = isset($range['from']) ? $range['from'] : null; $to = isset($range['to']) ? $range['to'] : null; $this->addRange($from, $to); } else { $this->addMask($range); } } }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param string $interval */ public function __construct($name, $field = null, $interval = null) { parent::__construct($name); $this->setField($field); $this->setInterval($interval); }
/** * @param string $name * @param string $children */ public function __construct($name, $children = null) { parent::__construct($name); $this->setChildren($children); }
/** * Inner aggregations container init. * * @param string $name * @param string $field */ public function __construct($name, $field = null) { parent::__construct($name); $this->setField($field); }
/** * @param string $name * @param $bucketsPath */ public function __construct($name, $bucketsPath) { parent::__construct($name); $this->setBucketsPath($bucketsPath); }
/** * Inner aggregations container init. * * @param string $name * @param string $field * @param bool $wrapLongitude */ public function __construct($name, $field = null, $wrapLongitude = true) { parent::__construct($name); $this->setField($field); $this->setWrapLongitude($wrapLongitude); }
/** * Inner aggregations container init. * * @param string $name * @param string $path */ public function __construct($name, $path = null) { parent::__construct($name); $this->setPath($path); }