lib/Elastica/Client.php
public function deleteIds(array $ids, $index, $type, $routing = false)
    {
        if (empty($ids)) {
            throw new InvalidException('Array has to consist of at least one id');
        }

        $bulk = new Bulk($this);
        $bulk->setIndex($index);
        $bulk->setType($type);

        foreach ($ids as $id) {
            $action = new Action(Action::OP_TYPE_DELETE);
            $action->setId($id);

            if (!empty($routing)) {
                $action->setRouting($routing);
            }

            $bulk->addAction($action);
        }

        return $bulk->send();
    }
public function deleteIds(array $ids, $index, $type, $routing = false)
    {
        if (empty($ids)) {
            throw new InvalidException('Array has to consist of at least one id');
        }

        $bulk = new Bulk($this);
        $bulk->setIndex($index);
        $bulk->setType($type);

        foreach ($ids as $id) {
            $action = new Action(Action::OP_TYPE_DELETE);
            $action->setId($id);

            if (!empty($routing)) {
                $action->setRouting($routing);
            }

            $bulk->addAction($action);
        }

        return $bulk->send();
    }
public function deleteIds ( array $ ids , $ index , $ type , $ routing = false ) { if ( empty ( $ ids ) ) { throw new InvalidException ( 'Array has to consist of at least one id' ) ; } $ bulk = new Bulk ( $ this ) ; $ bulk -> setIndex ( $ index ) ; $ bulk -> setType ( $ type ) ; foreach ( $ ids as $ id ) { $ action = new Action ( Action :: OP_TYPE_DELETE ) ; $ action -> setId ( $ id ) ; if ( ! empty ( $ routing ) ) { $ action -> setRouting ( $ routing ) ; } $ bulk -> addAction ( $ action ) ; } return $ bulk -> send ( ) ; }
Deletes documents with the given ids, index, type from the index.

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

@param array                  $ids     Document ids
@param string|\Elastica\Index $index   Index name
@param string|\Elastica\Type  $type    Type of documents
@param string|bool            $routing Optional routing key for all ids

@throws \Elastica\Exception\InvalidException

@return \Elastica\Bulk\ResponseSet Response  object
Deletes documents with the given ids index type from the index .