Skip to main content

Stats

Stats give information about indexes, including the number of documents and vectors in the index. Note that the number of vectors is not necessarily the same as the number of documents, as a document can have multiple vectors or zero vectors.


Please also be aware that the number of documents and the number of vectors may not be immediately consistent during indexing processes. However, these values will be eventually consistent with each other after indexing processes have finished.

Stats Object

{
"numberOfDocuments": 4,
"numberOfVectors": 4,
"backend": {
"memoryUsedPercentage": 0.73484113083,
"storageUsedPercentage": 37.01321365493
}
}
NameTypeDescription
numberOfDocumentsIntegernumber of documents in the index
numberOfVectorsIntegernumber of vectors in the index

Get index stats

Get statistics and information about an index

GET /indexes/{index_name}/stats

Path parameters

NameTypeDescription
index_nameStringname of the index

Example

=== "Marqo Open Source" === "cURL"

curl -XGET http://localhost:8882/indexes/my-first-index/stats

=== "Python"

results = client.index("my-first-index").get_stats()

=== "Marqo Cloud" For Marqo Cloud, you will need to access the endpoint of your index and replace your_endpoint with this. To do this, visit Find Your Endpoint. You will also need your API Key. To obtain this key visit Find Your API Key. === "cURL"

curl -XGET your_endpoint/indexes/my-first-index/stats \ 
-H 'x-api-key: XXXXXXXXXXXXXXX'

=== "Python"

results = client.index("my-first-index").get_stats()

Response: 200

{
"numberOfDocuments": 4,
"numberOfVectors": 4,
"backend": {
"memoryUsedPercentage": 0.73484113083,
"storageUsedPercentage": 37.01321365493
}
}