コード例 #1
0
 /**
  * @return View
  */
 public function build()
 {
     if ($this->setVersion && $this->singleDocument != null) {
         $this->view->setHeader('ETag', hash('sha256', $this->singleDocument->getId() . $this->singleDocument->getVersion()));
     }
     return $this->view;
 }
コード例 #2
0
 /**
  * @param string $identity
  * @param Document $document
  */
 public function upsert($identity, Document $document)
 {
     $this->client->index(['index' => $this->index, 'type' => $this->type, 'id' => $identity, 'body' => $document->serialize(), 'refresh' => true]);
 }