lib/Elastica/Type.php
public function deleteById($id, array $options = [])
    {
        if (empty($id) || !\trim($id)) {
            throw new \InvalidArgumentException();
        }

        $endpoint = new Delete();
        $endpoint->setID($id);
        $endpoint->setParams($options);

        $response = $this->requestEndpoint($endpoint);

        $responseData = $response->getData();

        if (isset($responseData['result']) && 'not_found' == $responseData['result']) {
            throw new NotFoundException('Doc id '.$id.' not found and can not be deleted');
        }

        return $response;
    }
public function deleteById($id, array $options = [])
    {
        if (empty($id) || !\trim($id)) {
            throw new \InvalidArgumentException();
        }

        $endpoint = new Delete();
        $endpoint->setID($id);
        $endpoint->setParams($options);

        $response = $this->requestEndpoint($endpoint);

        $responseData = $response->getData();

        if (isset($responseData['result']) && 'not_found' == $responseData['result']) {
            throw new NotFoundException('Doc id '.$id.' not found and can not be deleted');
        }

        return $response;
    }
public function deleteById ( $ id , array $ options = [ ] ) { if ( empty ( $ id ) || ! \ trim ( $ id ) ) { throw new \ InvalidArgumentException ( ) ; } $ endpoint = new Delete ( ) ; $ endpoint -> setID ( $ id ) ; $ endpoint -> setParams ( $ options ) ; $ response = $ this -> requestEndpoint ( $ endpoint ) ; $ responseData = $ response -> getData ( ) ; if ( isset ( $ responseData [ 'result' ] ) && 'not_found' == $ responseData [ 'result' ] ) { throw new NotFoundException ( 'Doc id ' . $ id . ' not found and can not be deleted' ) ; } return $ response ; }
Deletes an entry by its unique identifier.

@see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html

@param int|string $id      Document id
@param array      $options

@throws \InvalidArgumentException
@throws \Elastica\Exception\NotFoundException

@return \Elastica\Response Response object
Deletes an entry by its unique identifier .