예제 #1
0
 public function testConfigMode()
 {
     $options = array('waitflush' => true, 'waitsearcher' => false, 'expungedeletes' => true);
     $command = new Solarium_Query_Update_Command_Commit($options);
     $this->assertEquals(true, $command->getWaitFlush());
     $this->assertEquals(false, $command->getWaitSearcher());
     $this->assertEquals(true, $command->getExpungeDeletes());
 }
예제 #2
0
 /**
  * Build XML for a commit command
  *
  * @param Solarium_Query_Update_Command_Commit $command
  * @return string
  */
 public function buildCommitXml($command)
 {
     $xml = '<commit';
     $xml .= $this->boolAttrib('waitFlush', $command->getWaitFlush());
     $xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher());
     $xml .= $this->boolAttrib('expungeDeletes', $command->getExpungeDeletes());
     $xml .= '/>';
     return $xml;
 }
예제 #3
0
 /**
  * Convenience method to add a commit command
  *
  * If you need more control, like choosing a key for the command you need to
  * create you own command instance and use the add method.
  *
  * @param boolean $waitFlush
  * @param boolean $waitSearcher
  * @param boolean $expungeDeletes
  * @return Solarium_Query_Update Provides fluent interface
  */
 public function addCommit($waitFlush = null, $waitSearcher = null, $expungeDeletes = null)
 {
     $commit = new Solarium_Query_Update_Command_Commit();
     if (null !== $waitFlush) {
         $commit->setWaitFlush($waitFlush);
     }
     if (null !== $waitSearcher) {
         $commit->setWaitSearcher($waitSearcher);
     }
     if (null !== $expungeDeletes) {
         $commit->setExpungeDeletes($expungeDeletes);
     }
     return $this->add(null, $commit);
 }