Retrieve statistics for a collection, including the total document count, index completeness, and per-partition breakdown.
Prerequisites
Before you begin, make sure that you have:
Request syntax
GET https://{Endpoint}/v1/collections/{CollectionName}/statsRequest parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
{Endpoint} | Path | String | Yes | The cluster endpoint. Find this on the cluster details page in the console. |
{CollectionName} | Path | String | Yes | The name of the collection to query. |
dashvector-auth-token | Header | String | Yes | The API key for authentication. |
Example
Replace <your-api-key> with your API key and <your-cluster-endpoint> with your cluster endpoint.
This example queries statistics for a collection named quickstart. To create this collection, see the Create a collection example.
curl -H 'dashvector-auth-token: <your-api-key>' \
https://<your-cluster-endpoint>/v1/collections/quickstart/statsSample response:
{
"request_id": "14448bcb-c9a3-49a8-9152-0de3990bce59",
"code": 0,
"message": "Success",
"output": {
"total_doc_count": "26",
"index_completeness": 1.0,
"partitions": {
"default": {
"total_doc_count": "26"
}
}
}
}Key fields in the response:
total_doc_count: The total number of documents across all partitions.index_completeness: The indexing completeness of the collection.partitions: A per-partition breakdown of document counts.
Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
code | Integer | Status code. 0 indicates success. For other codes, see Status codes. | 0 |
message | String | Response message. | success |
request_id | String | Unique request identifier for troubleshooting. | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
output | Object | Collection statistics. For the full schema, see CollectionStats. | -- |
该文章对您有帮助吗?