public function deleteByQuery($query, array $options = array())
{
$options += array('refresh' => true);
if (is_array($query)) {
/**
* Array implies using the JSON query DSL
*/
$url = $this->buildUrl(array($this->type, "_query"));
$result = $this->call($url, "DELETE", $query);
} elseif (is_string($query)) {
/**
* String based search means http query string search
*/
$url = $this->buildUrl(array($this->type, "_query"), array('q' => $query));
$result = $this->call($url, "DELETE");
}
if ($options['refresh']) {
$this->request('_refresh', "POST");
}
return !isset($result['error']);
}