public function testConfigMode()
 {
     $options = array('waitflush' => true, 'waitsearcher' => false, 'maxsegments' => 6);
     $command = new Solarium_Query_Update_Command_Optimize($options);
     $this->assertEquals(true, $command->getWaitFlush());
     $this->assertEquals(false, $command->getWaitSearcher());
     $this->assertEquals(6, $command->getMaxSegments());
 }
示例#2
0
 /**
  * Build XML for an update command
  *
  * @param Solarium_Query_Update_Command_Optimize $command
  * @return string
  */
 public function buildOptimizeXml($command)
 {
     $xml = '<optimize';
     $xml .= $this->boolAttrib('waitFlush', $command->getWaitFlush());
     $xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher());
     $xml .= $this->attrib('maxSegments', $command->getMaxSegments());
     $xml .= '/>';
     return $xml;
 }