Method 与 URL
查询指定 Collection 的信息:
POST https://{实例访问 IP 地址}:{实例网络端口}/collection/describe
。使用示例
curl -i -X POST \\-H 'Content-Type: application/json' \\-H 'Authorization: Bearer account=root&api_key=A5VOgsMpGWJhUI0WmUbY********************' \\http://10.0.X.X:80/collection/describe \\-d '{"database": "db-test","collection": "book-emb"}'
请求参数
参数名 | 是否必选 | 参数含义 | 配置方法 |
database | 是 | 指定 Collection 所在的 Database 名称。 | |
collection | 是 | 指定所需查询的 Collection 名称。 |
响应消息
/collection/describe 接口执行成功,将返回查询 Collection 的信息。
{"code": 0,"msg": "operation success","collection": {"database": "db-test","collection": "book-emb","documentCount": 4,"alias": ["alias-book-emb"],"replicaNum": 2,"shardNum": 1,"createTime": "2023-09-14 14:48:17","embedding": {"field": "text","vectorField": "vector","model": "bge-base-zh","status": "enabled"},"description": "this is the collection description","indexes": [{"fieldName": "id","fieldType": "string","indexType": "primaryKey"},{"fieldName": "author","fieldType": "string","indexType": "filter"},{"fieldName": "vector","fieldType": "vector","indexType": "HNSW","indexedCount": 4,"dimension": 768,"metricType": "COSINE","params": {"M": 16,"efConstruction": 200}},{"fieldName": "sparse_vector","fieldType": "sparseVector","indexType": "inverted","metricType": "IP"},{"fieldName": "bookName","fieldType": "string","indexType": "filter"}],"indexStatus": {"status": "ready","startTime": ""}}}
参数 | 子参数 | 子参数 | 参数含义 |
database | - | - | 显示 Collection 所在的 Database 名称。 |
collection | - | - | 显示 Collection 的名称。 |
documentCount | | | Collection 中的 Document 数量。 |
alias | - | - | Collection 的所有别名。 |
replicaNum | - | - | 显示 Collection 的副本数。 |
shardNum | - | - | 显示 Collection 的分片数。 |
createTime | - | - | 显示 Collection 的创建时间。 |
embedding | Embedding 功能相关参数。 | textField | 显示 Embedding 模型输入文本的字段名。 |
| | vectorField | 显示文本被向量化之后存储向量数据的字段名。 |
| | model | Embedding 模型的名称。 |
| | status | 说明该 Collection 是否配置 Embedding 模型。 enabled:已配置。 disabled:未配置。 |
description | - | - | 显示 Collection 的描述信息。 |
indexes | 主键索引 | fieldName | 标识索引对象为 id 。 |
| | filedType | 显示该索引对象的数据类型,固定为 string。 |
| | indexType | 该参数固定显示为 primaryKey 。即该索引对象以 id 为主键构建索引。 |
| 向量索引 | fieldName | 标识索引对象为 vector。 |
| | filedType | 指索引对象为 vector 的数据类型。即该参数固定为 vector 。 |
| | indexType | |
| | indexedCount | 索引对象为 vector 中包含的文档数。 |
| | dimension | 显示向量维度。 |
| | metricType | 显示向量之间的距离度量的算法。 |
| | params | 显示索引类型对应的参数。 |
| Filter 索引 | fieldName | 自定义扩展字段,例如:author、bookName。 |
| | filedType | 显示自定义字段的数据类型。 |
| | indexType | 显示自定义字段索引类别为 filter 。 |
| 稀疏向量索引 | fieldName | 稀疏向量的字段名。 |
| | fieldType |
稀疏向量字段类型,固定为 sparseVector。
|
| |
indexType
|
稀疏向量的索引类型,当前定义为 inverted。
|
| | metricType | 稀疏向量之间距离度量的算法。当前仅支持设置为 IP, 欧几里得距离,计算向量之间的直线距离,所得的值越小,越与搜索值相似。 |
indexStatus
| 标识 Collection 是否有重建索引 | status | 标识当前 Collection 是否在重建索引。 initial:表示首次创建索引,尚未 Rebuild 构建索引。 ready:表示当前 Collection 已准备就绪,可正常使用。 training:表示当前 Collection 正在进行数据训练,即训练模型以生成向量数据。 building:表示当前 Collection 正在重建索引,即将生成的向量数据存储到新的索引中。 failed:重建索引失败,可能会影响集合读写操作。 |
| |
startTime
| 重建索引开始的时间。 |