/** * Delete a document from elasticsearch. * * @param array $payload * @return mixed */ public function delete() { if (!$this->indexIsDefined()) { throw new IndexMustBeDefinedException("To delete a document, index must be definded", 1); } if (!$this->typeIsDefined()) { throw new TypeMustBeDefinedException("To delete a document, type must be defined", 1); } $compiled = $this->grammar->compileDelete($this); return $this->processor->processDelete($this, $this->connection->documentDelete($compiled)); }