AWS DocumentDB 矢量索引选项明显缺失

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

我正在尝试在 DocumentDB 中创建 向量索引,但按照文档的示例,我不断收到错误:

db.collection.createIndex(
  { "<vectorField>": "vector" },
  { "name": "<indexName>",
    "vectorOptions": {
      "dimensions": <number_of_dimensions>,
      "similarity": " <euclidean> | <cosine> | <dotProduct> ",
      "lists": <number_of_lists> 
    }
  }
);

当我尝试在集合中的“嵌入”字段上创建索引时,我使用以下内容:

db.collection.createIndex({
    embedding: 'vector',
}, {
    name: "vectorEmbeddingIdx",
    vectorOptions: {
        dimensions: 2000,
        similarity: "euclidean",
        lists: 1,
    }
})

这会导致以下错误:

MongoServerError: vectorOptions input is required to create vector indexes

我一直在使用万能的谷歌,但找不到关于我的情况的文档。我是不是错过了什么?

vector indexing aws-documentdb
1个回答
0
投票

我发现解决方案是在 r5 实例上运行它。文档没有说得那么清楚,我也预计最新的实例类型(r6g)支持这一点。

通过在 DocumentDB 中降级或启动新实例,有关如何实现矢量索引和高效搜索的说明可以按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.