public function testConfigMode() { $options = array('softcommit' => true, 'waitsearcher' => false, 'maxsegments' => 6); $command = new Optimize($options); $this->assertEquals(true, $command->getSoftCommit()); $this->assertEquals(false, $command->getWaitSearcher()); $this->assertEquals(6, $command->getMaxSegments()); }
/** * Build XML for an update command * * @param Query\Command\Optimize $command * @return string */ public function buildOptimizeXml($command) { $xml = '<optimize'; $xml .= $this->boolAttrib('softCommit', $command->getSoftCommit()); $xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher()); $xml .= $this->attrib('maxSegments', $command->getMaxSegments()); $xml .= '/>'; return $xml; }