public function testStastistical() { $facet = new Simples_Request_Search_Facet(array('name' => 'stat1', 'script' => 'doc[\'num1\'].value + doc[\'num2\'].value'), array('type' => 'statistical')); $res = $facet->to('array'); $expected = array('stat1' => array('statistical' => array('script' => 'doc[\'num1\'].value + doc[\'num2\'].value'))); $this->assertEquals($expected, $res); }
/** * Merge a criteria with current. * * @param Simples_Request_Search_Criteria $facet Criteria to merge. * @return \Simples_Request_Search_Criteria This instance (fluid interface). */ public function merge(Simples_Request_Search_Facet $facet) { $this->_data = array_merge($this->_data, $facet->get()); unset($facet); $this->_type = $this->_type($this->_data, $this->_options); return $this; }