setInitScript($initScript); } if ($mapScript) { $this->setMapScript($mapScript); } if ($combineScript) { $this->setCombineScript($combineScript); } if ($reduceScript) { $this->setReduceScript($reduceScript); } } /** * Set the field for this aggregation. * * @param string $script the name of the document field on which to perform this aggregation * * @return $this */ public function setCombineScript($script) { return $this->setParam('combine_script', $script); } /** * Set the field for this aggregation. * * @param string $script the name of the document field on which to perform this aggregation * * @return $this */ public function setInitScript($script) { return $this->setParam('init_script', $script); } /** * Set the field for this aggregation. * * @param string $script the name of the document field on which to perform this aggregation * * @return $this */ public function setMapScript($script) { return $this->setParam('map_script', $script); } /** * Set the field for this aggregation. * * @param string $script the name of the document field on which to perform this aggregation * * @return $this */ public function setReduceScript($script) { return $this->setParam('reduce_script', $script); } }