Sleimanx2\Plastic\Connection::deleteStatement PHP Method

deleteStatement() public method

Execute a update statement on index;.
public deleteStatement ( array $params ) : array
$params array
return array
    public function deleteStatement(array $params)
    {
        return $this->elastic->delete($this->setStatementIndex($params));
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Delete a model document.
  *
  * @return mixed
  */
 public function delete()
 {
     $this->exitIfModelNotSet();
     $params = ['id' => $this->model->getKey(), 'type' => $this->model->getDocumentType(), 'index' => $this->model->getDocumentIndex()];
     // check if the document exists before deleting
     if ($this->connection->existsStatement($params)) {
         return $this->connection->deleteStatement($params);
     }
     return true;
 }