Example #1
0
 public function testCompleteRequest()
 {
     $this->query->addDeleteById(1);
     $this->query->addRollback();
     $this->query->addDeleteQuery('*:*');
     $this->query->addDocument(new Document(array('id' => 1)));
     $this->query->addCommit();
     $this->query->addOptimize();
     $this->assertEquals('<update>' . '<delete><id>1</id></delete>' . '<rollback/>' . '<delete><query>*:*</query></delete>' . '<add><doc><field name="id">1</field></doc></add>' . '<commit/>' . '<optimize/>' . '</update>', $this->builder->getRawData($this->query));
 }
 /**
  * Remove any document linked to current node-source.
  *
  * @param Solarium\QueryType\Update\Query\Query $update
  *
  * @return boolean
  */
 public function clean(Query $update)
 {
     $update->addDeleteQuery(static::IDENTIFIER_KEY . ':"' . $this->nodeSource->getId() . '"' . '&document_type_s:"' . static::DOCUMENT_TYPE . '"' . '&locale_s:"' . $this->nodeSource->getTranslation()->getLocale() . '"');
     return true;
 }