Search code examples
laravelmeilisearch

Laravel/Scout - How to get total number of documents?


I'm using meilisearch engine in laravel scout, Is it possible to get total number of documents (indexes)?


Solution

  • If you want to know how many documents there are on an index, you can get the stats of an index: https://docs.meilisearch.com/reference/api/stats.html#get-stat-of-an-index

    If you want to get all the documents of an index, you can use the GET documents route, make sure that the limit parameter is greater than the total number of documents in your index: https://docs.meilisearch.com/reference/api/documents.html#get-documents