describe

最近更新时间:2024-09-27 18:00:11

我的收藏

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 名称。
使用 /database/list 获取集群中的数据库列表,复制需查询的集合所属的数据库名。
collection
指定所需查询的 Collection 名称。
使用 /collection/list 获取指定数据库名下的 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
指定索引对象为 vector 的索引类型。当前所支持的索引类型及具体索引方式,请参见设计模型中的 Index
indexedCount
索引对象为 vector 中包含的文档数。
dimension
显示向量维度。
metricType
显示向量之间的距离度量的算法。
params
显示索引类型对应的参数。
Filter 索引
fieldName
自定义扩展字段,例如:author、bookName。
filedType
显示自定义字段的数据类型。
indexType
显示自定义字段索引类别为filter。在后续检索数据时,才能对该字段设置 Filter 条件表达式进行 混合检索
稀疏向量索引
fieldName
稀疏向量的字段名。
fieldType
稀疏向量字段类型,固定为 sparseVector
indexType
稀疏向量的索引类型,当前定义为 inverted
metricType
稀疏向量之间距离度量的算法。当前仅支持设置为 IP, 欧几里得距离,计算向量之间的直线距离,所得的值越小,越与搜索值相似。
indexStatus
标识 Collection 是否有重建索引
status
标识当前 Collection 是否在重建索引。
ready:表示当前 Collection 已准备就绪,可正常使用。
training:表示当前 Collection 正在进行数据训练,即训练模型以生成向量数据。
building:表示当前 Collection 正在重建索引,即将生成的向量数据存储到新的索引中。
failed:重建索引失败,可能会影响集合读写操作。
startTime
重建索引开始的时间。