View collection statistics

更新时间:
复制 MD 格式

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}/stats

Request parameters

ParameterLocationTypeRequiredDescription
{Endpoint}PathStringYesThe cluster endpoint. Find this on the cluster details page in the console.
{CollectionName}PathStringYesThe name of the collection to query.
dashvector-auth-tokenHeaderStringYesThe 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/stats

Sample 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

ParameterTypeDescriptionExample
codeIntegerStatus code. 0 indicates success. For other codes, see Status codes.0
messageStringResponse message.success
request_idStringUnique request identifier for troubleshooting.19215409-ea66-4db9-8764-26ce2eb5bb99
outputObjectCollection statistics. For the full schema, see CollectionStats.--