We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a66254 commit 601c877Copy full SHA for 601c877
app/base/tools/Search/Manager.php
@@ -94,16 +94,20 @@ public function flush() : array
94
]);
95
}
96
97
- public function countAll() : int
+ public function countAll($query = '*') : int
98
{
99
+ if (is_string($query)) {
100
+ $query = [
101
+ "query_string" => [
102
+ "query" => $query,
103
+ ],
104
+ ];
105
+ }
106
+
107
return $this->getClient()->count([
108
'index' => self::INDEX_NAME,
109
'body' => [
- "query" => [
- "query_string" => [
- "query" => "*",
- ],
110
111
],
112
])['count'];
113
0 commit comments