本文整理汇总了PHP中Elasticsearch\Client::deleteByQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::deleteByQuery方法的具体用法?PHP Client::deleteByQuery怎么用?PHP Client::deleteByQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elasticsearch\Client
的用法示例。
在下文中一共展示了Client::deleteByQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @author Martin Lonsky (martin@lonsky.net, +420 736 645876)
* @return array
* @throws \Exception
*/
public function execute() : array
{
try {
$_result = $this->_client->deleteByQuery($this->getPreparedParams());
} catch (\Exception $e) {
$this->clearParams();
throw $e;
}
$this->clearParams();
return $_result;
}
示例2: delete
public function delete()
{
$body = $this->buildRequestBody(new Highlight(false));
try {
$result = $this->client->deleteByQuery($body);
} catch (\Exception $e) {
if ($this->debug) {
$this->logger->debug($this->translator->get('query_error') . json_encode($body));
}
$result = null;
}
return $result;
}
示例3: deleteAll
/**
* Deletes all entities managed by the repository.
* @return void
*/
public function deleteAll()
{
$this->elasticsearchClient->deleteByQuery(array('index' => $this->index, 'type' => $this->getType()));
}
示例4: nuke
/**
* Delete all index based on an eloquent model instance.
*
* @param Searchable $model
*
* @return array
*/
public function nuke(Searchable $model)
{
return $this->client->deleteByQuery(['index' => $model->getIndexableName(), 'type' => $model->getIndexableType(), 'body' => ['query' => ['match_all' => []]]]);
}