Stats

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

Get stat of an index

GET

/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

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

Response: 200 Ok

{
  "numberOfDocuments": 19654,
  "isIndexing": false,
  "fieldDistribution": {
    "poster": 19654,
    "release_date": 19654,
    "title": 19654,
    "id": 19654,
    "overview": 19654
  }
}

Get stats of all indexes

GET

/stats

Get stats of all indexes.

NOTE

databaseSize is expressed in bytes.

Example

<>

cURL

JS

Python

PHP

Java

Ruby

Go

Rust

Swift

Dart

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

Response: 200 Ok

{
  "databaseSize": 447819776,
  "lastUpdate": "2019-11-15T11:15:22.092896Z",
  "indexes": {
    "movies": {
      "numberOfDocuments": 19654,
      "isIndexing": false,
      "fieldDistribution": {
        "poster": 19654,
        "overview": 19654,
        "title": 19654,
        "id": 19654,
        "release_date": 19654
      }
    },
    "rangemovies": {
      "numberOfDocuments": 19654,
      "isIndexing": false,
      "fieldDistribution": {
        "overview": 19654,
        "id": 19654,
        "title": 19654
      }
    }
  }
}