Exemplo n.º 1
0
 /**
  * Convenience method to add a 'add documents' 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 array $documents
  * @param boolean $overwrite
  * @param int $commitWithin
  * @return Solarium_Query_Update Provides fluent interface
  */
 public function addDocuments($documents, $overwrite = null, $commitWithin = null)
 {
     $add = new Solarium_Query_Update_Command_Add();
     if (null !== $overwrite) {
         $add->setOverwrite($overwrite);
     }
     if (null !== $commitWithin) {
         $add->setCommitWithin($commitWithin);
     }
     $add->addDocuments($documents);
     return $this->add(null, $add);
 }