Skip to content

Commit

Permalink
Add index count utility method
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Dec 14, 2023
1 parent 8f0d5b2 commit 412f472
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Meilisearch/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,9 @@ private function getSafeDocumentID(string $entryReference)
})
->implode('---');
}

public function getCount()
{
return $this->getIndex()->stats()['numberOfDocuments'] ?? 0;
}
}

0 comments on commit 412f472

Please sign in to comment.