Stats

Stats gives extended information and metrics about indexes and the MeiliSearch database.

Get stat of an index

GET

  1. /indexes/:index_uid/stats

Get stats of an index.

Path variables

VariableDescription
index_uidThe index UID

Example

<>

cURL

JS

Python

PHP

Java

Ruby

Go

Rust

Swift

Dart

  1. curl \
  2. -X GET 'http://localhost:7700/indexes/movies/stats'
  1. client.index('movies').getStats()
  1. client.index('movies').get_stats()
  1. $client->index('movies')->stats();
  1. client.index("movies").getStats();
  1. client.index('movies').stats
  1. client.Index("movies").GetStats()
  1. let stats: IndexStats = movies.get_stats().await.unwrap();
  1. client.index("movies").stats { (result: Result<Stat, Swift.Error>) in
  2. switch result {
  3. case .success(let stat):
  4. print(update)
  5. case .failure(let error):
  6. print(error)
  7. }
  8. }
  1. await client.index('movies').getStats();

Response: 200 Ok

  1. {
  2. "numberOfDocuments": 19654,
  3. "isIndexing": false,
  4. "fieldDistribution": {
  5. "poster": 19654,
  6. "release_date": 19654,
  7. "title": 19654,
  8. "id": 19654,
  9. "overview": 19654
  10. }
  11. }

Get stats of all indexes

GET

  1. /stats

Get stats of all indexes.

NOTE

databaseSize is expressed in bytes.

Example

<>

cURL

JS

Python

PHP

Java

Ruby

Go

Rust

Swift

Dart

  1. curl \
  2. -X GET 'http://localhost:7700/stats'
  1. client.stats()
  1. client.get_all_stats()
  1. $client->stats();
  1. client.getStats();
  1. client.stats
  1. client.GetAllStats()
  1. let stats: ClientStats = client.get_stats().await.unwrap();
  1. client.allStats { (result: Result<AllStats, Swift.Error>) in
  2. switch result {
  3. case .success(let allStats):
  4. print(update)
  5. case .failure(let error):
  6. print(error)
  7. }
  8. }
  1. await client.getAllStats();

Response: 200 Ok

  1. {
  2. "databaseSize": 447819776,
  3. "lastUpdate": "2019-11-15T11:15:22.092896Z",
  4. "indexes": {
  5. "movies": {
  6. "numberOfDocuments": 19654,
  7. "isIndexing": false,
  8. "fieldDistribution": {
  9. "poster": 19654,
  10. "overview": 19654,
  11. "title": 19654,
  12. "id": 19654,
  13. "release_date": 19654
  14. }
  15. },
  16. "rangemovies": {
  17. "numberOfDocuments": 19654,
  18. "isIndexing": false,
  19. "fieldDistribution": {
  20. "overview": 19654,
  21. "id": 19654,
  22. "title": 19654
  23. }
  24. }
  25. }
  26. }