The /stats route gives extended information and metrics about indexes and the Meilisearch database.

Stats object

{
  "databaseSize": 447819776,
  "usedDatabaseSize": 196608,
  "lastUpdate": "2019-11-15T11:15:22.092896Z",
  "indexes": {
    "movies": {
      "numberOfDocuments": 19654,
      "numberOfEmbeddedDocuments": 1,
      "numberOfEmbeddings": 1,
      "isIndexing": false,
      "fieldDistribution": {
        "poster": 19654,
        "overview": 19654,
        "title": 19654,
        "id": 19654,
        "release_date": 19654
      }
    },
    "books": {
      "numberOfDocuments": 5,
      "numberOfEmbeddedDocuments": 5,
      "numberOfEmbeddings": 10,
      "isIndexing": false,
      "fieldDistribution": {
        "id": 5,
        "title": 5,
        "author": 5,
        "price": 5, 
        "genres": 5
      }
    }
  }
}
NameTypeDescription
databaseSizeIntegerStorage space claimed by Meilisearch and LMDB in bytes
usedDatabaseSizeIntegerStorage space used by the database in bytes, excluding unused space claimed by LMDB
lastUpdateStringWhen the last update was made to the database in the RFC 3339 format
indexesObjectObject containing the statistics for each index found in the database
numberOfDocumentsIntegerTotal number of documents in an index
numberOfEmbeddedDocumentsIntegerTotal number of documents with at least one embedding
numberOfEmbeddingsIntegerTotal number of embeddings in an index
isIndexingBooleanIf true, the index is still processing documents and attempts to search will result in undefined behavior
fieldDistributionObjectShows every field in the index along with the total number of documents containing that field in said index

fieldDistribution is not impacted by searchableAttributes or displayedAttributes. Even if a field is not displayed or searchable, it will still appear in the fieldDistribution object.

Get stats of all indexes

GET
/stats

Get stats of all indexes.

Example

curl \
  -X GET 'MEILISEARCH_URL/stats'

Response: 200 Ok

{
  "databaseSize": 447819776,
  "usedDatabaseSize": 196608,
  "lastUpdate": "2019-11-15T11:15:22.092896Z",
  "indexes": {
    "movies": {
      "numberOfDocuments": 19654,
      "numberOfEmbeddedDocuments": 1,
      "numberOfEmbeddings": 1,
      "isIndexing": false,
      "fieldDistribution": {
        "poster": 19654,
        "overview": 19654,
        "title": 19654,
        "id": 19654,
        "release_date": 19654
      }
    },
    "books": {
      "numberOfDocuments": 5,
      "numberOfEmbeddedDocuments": 5,
      "numberOfEmbeddings": 10,
      "isIndexing": false,
      "fieldDistribution": {
        "id": 5,
        "title": 5,
        "author": 5,
        "price": 5, 
        "genres": 5
      }
    }
  }
}

Get stats of an index

GET
/indexes/{index_uid}/stats

Get stats of an index.

Path parameters

NameTypeDescription
index_uid *Stringuid of the requested index

Example

curl \
  -X GET 'MEILISEARCH_URL/indexes/movies/stats'

Response: 200 Ok

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

Was this page helpful?