list

最近更新时间:2025-11-06 10:20:32

我的收藏

Method 与 URL

查询指定 Base 类 Database 中所有的 Collection:POST https://{实例访问 IP 地址}:{实例网络端口}/collection/list

使用示例

curl -i -X POST \\
-H 'Content-Type: application/json' \\
-H 'Authorization: Bearer account=root&api_key=A5VOgsMpGWJhUI0WmUbY********************' \\
http://10.0.X.X:80/collection/list \\
-d '{
"database": "db-test"
}'

请求参数

参数
是否必选
参数含义
配置方法
database
设置 Collection 所属的 Database 库名。
使用 /database/list 获取集群中的数据库列表,复制需删除集合所属的数据库名。

响应信息

/collection/list 接口执行成功,将返回数据库中所有的 Collection。
{
"code": 0,
"msg": "Operation success",
"collections": [
{
"database": "db-test",
"collection": "book-emb",
"documentCount": 0,
"alias": [
"alias-book-emb"
],
"replicaNum": 0,
"shardNum": 1,
"createTime": "2024-09-05 11:14:43",
"embedding": {
"field": "text",
"vectorField": "vector",
"model": "bge-base-zh",
"status": "enabled"
},
"description": "this is the collection description",
"indexes": [
{
"fieldName": "vector",
"fieldType": "vector",
"indexType": "HNSW",
"indexedCount": 0,
"dimension": 768,
"metricType": "COSINE",
"params": {
"M": 16,
"efConstruction": 200
}
},
{
"fieldName": "bookName",
"fieldType": "string",
"indexType": "filter"
},
{
"fieldName": "sparse_vector",
"fieldType": "sparseVector",
"indexType": "inverted",
"metricType": "IP"
},
{
"fieldName": "id",
"fieldType": "string",
"indexType": "primaryKey"
},
{
"fieldName": "author",
"fieldType": "string",
"indexType": "filter"
}
],
"indexStatus": {
"status": "ready",
"startTime": ""
}
},
{
"database": "db-test",
"collection": "book-vector",
"documentCount": 0,
"replicaNum": 0,
"shardNum": 1,
"createTime": "2024-09-05 15:24:07",
"description": "this is the collection description",
"indexes": [
{
"fieldName": "bookName",
"fieldType": "string",
"indexType": "filter"
},
{
"fieldName": "id",
"fieldType": "string",
"indexType": "primaryKey"
},
{
"fieldName": "vector",
"fieldType": "vector",
"indexType": "HNSW",
"indexedCount": 0,
"dimension": 3,
"metricType": "COSINE",
"params": {
"M": 16,
"efConstruction": 200
}
},
{
"fieldName": "sparse_vector",
"fieldType": "sparseVector",
"indexType": "inverted",
"metricType": "IP"
},
{
"fieldName": "author",
"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
fieldType
主键索引数据类型,固定为 string。
indexType
该参数固定显示为 primaryKey。即该索引对象以 id 为主键构建索引。
向量索引
fieldName
标识索引字段,固定为 vector
fieldType
向量索引的数据类型,固定为 vector
indexType
向量索引的索引类型。具体信息,请参见 索引类型
indexedCount
向量索引的文档数量。
dimension
向量维度。
metricType
向量之间的距离度量的算法。
params
向量索引类型对应的参数。
Filter 索引
fieldName
自定义扩展字段,例如:author、bookName。
fieldType
自定义字段的数据类型。
indexType
自定义字段索引类别为filter
稀疏向量索引
fieldName
稀疏向量的字段名。
fieldType
稀疏向量字段类型,固定为 sparseVector
indexType
稀疏向量的索引类型,当前定义为 inverted
metricType
稀疏向量之间距离度量的算法。当前仅支持设置为 IP, 欧几里得距离,计算向量之间的直线距离,所得的值越小,越与搜索值相似。
diskSwapEnabled
指定稀疏向量存储方式。
true:开启磁盘存储。
false:关闭磁盘存储,使用内存存储。默认值为 false。

indexStatus
标识 Collection 是否有重建索引
status
标识当前 Collection 索引构建状态。
initial:索引已创建但尚未构建,处于初始状态。
ready:索引构建成功且已就绪,可正常执行操作。
training:正在训练机器学习模型以生成向量数据。
building:正在构建向量索引结构并存储向量数据。
building_scalar:正在构建标量索引。
building_sparse:正在构建稀疏向量索引。
failed:索引构建失败,需修复后方可正常操作。
startTime
重建索引开始的时间。