接口定义
DescribeCollectionView() 接口用于查询指定 CollectionView 的信息。
func (AICollectionViewInterface) DescribeCollectionView(ctx context.Context, name string) (result *DescribeAICollectionViewResult, err error)
使用示例
如下示例,查询集合视图 go-sdk-test-ai-coll 的配置信息。
var (ctx = context.Background()aiDatabase = "go-sdk-test-ai-db"collectionViewName = "go-sdk-test-ai-coll")db := client.AIDatabase(aiDatabase)coll, _ := db.DescribeCollectionView(ctx, collectionViewName)data, _ := json.Marshal(coll)log.Printf("DescribeCollection result: %+v", string(data))
入参描述
参数名 | 是否必选 | 参数含义 | 配置方法及要求 |
collectionViewName | 是 | 指定所需查询的 CollectionView 名称。 |
出参描述
{"databaseName": "go-sdk-test-ai-db","collectionViewName": "go-sdk-test-ai-coll","alias": null,"embedding": {"language": "zh","enableWordsEmbedding": true},"splitterPreprocess": {"appendTitleToChunk": true,"appendKeywordsToChunk": false},"indexedDocumentSets": 0,"totalDocumentSets": 0,"unIndexedDocumentSets": 0,"filterIndexes": [{"FieldName": "documentSetId","FieldType": "string","ElemType": "","IndexType": "primaryKey"}, {"FieldName": "documentSetName","FieldType": "string","ElemType": "","IndexType": "filter"}, {"FieldName": "author_name","FieldType": "string","ElemType": "","IndexType": "filter"}],"description": "test ai collectionView","createTime": "2023-12-20T17:48:03Z"}
参数 | 子参数 | 子参数 | 参数含义 |
databaseName | - | - | 显示 collectionView 所在的 AI 类 Database 名称。 |
collectionViewName | - | - | 显示 collectionView 的名称。 |
embedding | | language | 指定文件的语言类型,取值如下所示: zh:中文。 en:英文。 mutil:多语言。 |
| | enableWordsEmbedding | 配置在检索时,是否开启词(Words)向量精排,并进行词向量化。 true:开启。 false:不开启,默认为 false。 |
alias | - | - | |
createTime | - | - | 显示 CollectionView 的创建时间。 |
description | - | - | 显示 CollectionView 的描述信息。 |
stats
| 文件处理的状态 |
indexedDocumentSets
| 已处理完成的文件的数量。 |
| |
totalDocumentSets
| 所有的文件的数量。 |
| |
unIndexedDocumentSets
| 未处理的文件数量。 |
splitterPreprocess
| 文件预处理策略 |
appendTitleToChunk
| 在对文件拆分时,配置是否将 Title 追加到切分后的段落后面一并 Embedding。取值如下所示: True:将段落 Title 追加到切分后的段落。 False:不追加。 |
| |
appendKeywordsToChunk
| 在对文件拆分时,配置是否将关键字 keywords 追加到切分后的段落一并 Embedding。取值如下所示: false:不追加。 true:将全文的 keywords 追加到切分后的段落。 |
Indexes
| 默认以 documentSetId 文件ID 创建主键索引 | fieldName | 标识索引对象为 documentSetId 。 |
| | filedType | 显示该索引对象的数据类型,固定为 string 。 |
| | indexType | 该参数固定显示为 primaryKey 。 |
| 默认以 documentSetName 文件名创建 Filter 索引 | fieldName | 标识索引对象为文件名,固定为 documentSetName 。 |
| | filedType | 显示索引对象为文件名的数据类型,固定为 string 。 |
| | indexType | 显示索引对象为文件名的索引类型,固定为 filter 。在后续检索数据时,才能对该字段设置 Filter 条件表达式检索文件。 |
| 其他自定义需建立 Filter 索引的标量字段 | fieldName | 自定义扩展字段,例如:author、tags。 |
| | filedType | 显示自定义字段的数据类型。 |
| | indexType |