diff --git a/Service/IndexService.php b/Service/IndexService.php index 10c84282..0c09fbca 100644 --- a/Service/IndexService.php +++ b/Service/IndexService.php @@ -318,6 +318,21 @@ public function getIndexDocumentCount(): int return $results['count']; } + public function count(Search $search, array $params = []) + { + $body = array_merge( + [ + 'index' => $this->getIndexName(), + 'body' => $search->toArray(), + ], + $params + ); + + $results = $this->getClient()->count($body); + + return $results['count']; + } + public function remove($id, $routing = null) { $params = [