eZ\Publish\Core\Search\Elasticsearch\Content\Gateway\Native::purgeIndex PHP Method

purgeIndex() public method

Deletes all documents of a given $type from the index.
public purgeIndex ( string $type )
$type string
    public function purgeIndex($type)
    {
        $result = $this->client->request('DELETE', "/{$this->indexName}/{$type}/_query?q=id:*");
        $this->flush();
        if ($result->headers['status'] !== 200) {
            //throw new RuntimeException(
            //    "Wrong HTTP status received from Elasticsearch: " . $result->headers["status"]
            //);
        }
    }