使用 gcloud CLI 在 Firestore 中创建单字段向量索引时出错

问题描述 投票:0回答:1

我正在尝试使用 gcloud 命令行界面 (CLI) 在 Firestore 数据库中创建单字段向量索引以启用向量搜索功能。

但是,我不断收到此错误:

错误:(gcloud.alpha.firestore.indexes.composite.create)[--field-config] 值无效:复合索引必须配置至少 2 个字段。对于单字段索引管理,请使用

gcloud firestore indexes fields
下的命令。

这是我正在运行的命令,基于官方文档以及我尝试查询集合时返回的内容:

gcloud alpha firestore indexes composite create --collection-group=People --query-scope=COLLECTION --field-config field-path="embedding",vector-config='{"dimension":"768", "flat": "{}"}'

我已确认:

  • 嵌入字段存在于我的 Firestore 文档中。
  • 我拥有创建索引所需的权限。
  • 我使用的是最新版本的 gcloud CLI。

我知道此功能仍处于 alpha 阶段,但我认为文档已损坏,因为它使用复合命令创建单个字段索引。

如何使用 gcloud CLI 在 Firestore 中创建单字段向量索引?

firebase google-cloud-platform google-cloud-firestore gcloud vectorstore
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.