对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

使用Kubernetes创建Atlas Vector Search索引

Atlas Kubernetes Operator supports Atlas Vector Search indexes on Atlas clusters. To learn more, see How to Index Fields for Vector Search.

  • 在部署 Atlas Kubernetes Operator 的情况下运行 Kubernetes 集群。

  • 任何集群层上的MongoDB版本6.0.11 、 7.0.2或更高版本。

    注意

    您创建的内容不能超过:

    • 在 M0 集群上具有 3 个索引。

    • 针对 Flex 集群的 10 个索引。

    您可以在 M10+ 集群上创建的索引数量没有限制。

  • 要为其创建Atlas Vector Search索引的集合。

You need the Project Data Access Admin or higher role to create and manage Atlas Vector Search indexes.

1

配置 spec.deploymentSpec.searchIndexes 对象。

以下参数应用于该对象:

Parameter
说明

DBName

人类可读标签,用于标识包含具有一个或多个 Atlas Search 索引的集合的现有数据库。

重要提示:您指定的数据库必须已经存在。 如果您没有现有数据库,请创建一个。

CollectionName

可读标签,用于标识包含一个或多个 Atlas Search 索引的集合。

Type

索引的类型。Atlas 接受以下值:

  • search

  • vectorSearch

要了解可用参数的更多信息,请参阅 AtlasDeployment 自定义资源。

示例:

运行以下命令。

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
name: my-atlas-cluster
namespace: mongodb-atlas-system
spec:
projectRef:
name: my-project
deploymentSpec:
backupEnabled: true
clusterType: REPLICASET
name: Test-cluster-M10
replicationSpecs:
- regionConfigs:
- backingProviderName: AWS
electableSpecs:
instanceSize: M10
nodeCount: 3
priority: 7
providerName: AWS
regionName: US_EAST_1
zoneName: Zone 1
searchIndexes:
- DBName: sample_airbnb
collectionName: listingsAndReviews
name: my-index
vectorSearch:
fields: |
[
{"my-field":{"type": "vector", { ...},
]
type: vectorSearch
terminationProtectionEnabled: false
EOF
给本页内容打分