Retrieve statistical information about a specific partition in a collection, such as the total document count. Use this endpoint to monitor data ingestion progress, verify data distribution across partitions, or check partition size before performing operations.
Prerequisites
Before you begin, make sure that you have:
A DashVector cluster. For more information, see Create a cluster
An API key. For more information, see Manage API keys
The latest version of the DashVector SDK. For more information, see Install DashVector SDK
Request syntax
GET https://{Endpoint}/v1/collections/{CollectionName}/partitions/{PartitionName}/statsRequest parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
{Endpoint} | Path | String | Yes | The cluster endpoint. You can find this on the cluster details page in the console. |
{CollectionName} | Path | String | Yes | The collection name. |
{PartitionName} | Path | String | Yes | The partition name. |
dashvector-auth-token | Header | String | Yes | The API key. |
Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
code | Integer | The status code. 0 indicates success. For other values, see Status codes. | 0 |
message | String | A human-readable status message. | Success |
request_id | String | The unique request identifier. Use this value when troubleshooting issues with technical support. | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
output | Object | The partition statistics object. Contains total_doc_count (String): the total number of documents in the partition. For the full data type definition, see PartitionStats. | See the following example. |
Example
This example retrieves statistics for a partition named shoes in the quickstart collection.
Before you run this example:
Replace
YOUR_API_KEYwith your API key.Replace
YOUR_CLUSTER_ENDPOINTwith your cluster endpoint.Create a collection named
quickstart. See the "Example" section in Create a collection.Create a partition named
shoes. See the "Example" section in Create a partition.
Request
curl -H 'dashvector-auth-token: YOUR_API_KEY' \
https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/partitions/shoes/statsResponse
{
"request_id": "14448bcb-c9a3-49a8-9152-0de3990bce59",
"code": 0,
"message": "Success",
"output": {
"total_doc_count": "0"
}
}