Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
Click here >
Docs 菜单
Docs 主页

常见问题解答: MongoDB Search

不需要,在集群上启用MongoDB Search 时,不会产生任何额外费用或收费。但是,您可能会发现集群上的资源利用率有所增加,具体取决于索引集合大小或索引定义等因素。要管理和控制MongoDB搜索资源利用率,您可以部署个专用搜索节点,每个节点会产生额外费用。我们建议在您的生产环境中使用此方法。

提示

  • 什么是MongoDB Search?

  • 搜索节点成本

是的。以下MongoDB Search 操作符支持部分字符串匹配查询:

是。您可以将 wildcardregex 操作符与自定义分析器一起使用,以执行不区分大小写的搜索。您可以使用以下分词器和词元筛选器定义自定义分析器,以执行通配符不区分大小写搜索:

是的。MongoDB Search StoredSource 选项存储原始值。要在 $search 阶段之后对使用 returnStoredSource 选项返回的结果执行不区分大小写的操作,必须在创建集合时将集合的默认规则强度设立为 12,并且不得指定其他排序规则在查询和索引中。

If you add shards to a collection with an existing MongoDB Search index, an initial sync occurs on the newly added shards for that MongoDB Search index. Each shard's MongoDB Search index contains only the documents from the collection that exists on that shard. To learn more, see Shard a Global Collection.

警告:如果对已经有 MongoDB Search 索引的集合进行分片,在分片上建立索引时,可能会出现搜索结果不完整的短暂现象。此外,如果您为包含 MongoDB Search 索引的分片集合添加分片,在添加的分片完成初始同步过程之前,针对该集合的搜索查询可能会返回不完整的结果。要了解更多信息,请参阅初始同步进程。

不可以,您不能使用分片键对特定分片或分片子集运行MongoDB Search 查询。在分片集群环境中, MongoDB搜索查询是在所有分片上运行的分散-聚集查询。

但是,如果您使用区域将分片的集合分布在集群中的一部分分片上, MongoDB Search 会将查询路由到包含您正在查询的集合的分片的区域,并仅对以下查询运行$search 查询:集合所在的分片。

By default, queries run on the primary node. You can configure your read preference or use replica set tags to specify read preference. To learn more, see What is MongoDB Search?.

是,您可以执行以下操作以复制索引:

1

您可以从 Search & Vector Search 选项或 Data Explorer go 到 MongoDB搜索页面。

  1. 如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含项目的组织。

  2. 如果尚未显示,请从导航栏的 Projects 菜单中选择您的项目。

  3. 在侧边栏中,单击 Database 标题下的 Search & Vector Search

    • 如果没有集群,请单击 Create cluster 创建一个。要学习;了解更多信息,请参阅创建集群。

    • 如果您的项目有多个集群,请从 Select cluster 下拉列表中选择要使用的集群,然后单击 Go to Search

    显示“搜索和向量搜索”页面。

  1. 如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含项目的组织。

  2. 如果尚未显示,请从导航栏的 Projects 菜单中选择您的项目。

  3. 在侧边栏中,单击 Database 标题下的 Data Explorer

  4. 展开数据库并选择集合。

  5. 单击该集合的 Indexes 标签页。

  6. 单击横幅中的 Search and Vector Search 链接。

    显示“搜索和向量搜索”页面。

2
  1. 在要复制的索引上,单击 Action 列中的

  2. 单击 Edit With JSON Editor(连接)。

3
4

使用MongoDB Search JSON Editor 创建新索引。粘贴您复制的索引,然后单击 Create Search Index。创建MongoDB搜索索引后,您可以直接在MongoDB搜索 JSON Editor 或MongoDB搜索 Visual Index Builder 中进行所需的任何编辑。

注意

正在开发

我们目前正在为此研究一种不需要上述步骤的解决方案。如果您想为此功能投票或提交反馈,请使用MongoDB反馈

No, MongoDB Search uses memory for the JVM heap metrics, which stores the autocomplete and text tokens of your search index. Similar to other database engines, MongoDB Search stores the majority of the index files on the disk, which benefits from the underlying OS page cache.

  • 验证您输入的数据库和集合名称是否正确。如果您输入的数据库或集合名称不存在,Atlas 用户界面将临时构建索引并在不久后将其删除。

  • 如果您使用$out聚合阶段覆盖您的集合,则必须删除并重新创建Atlas Search索引,因为Atlas Search索引不会复制到目标集合。 要了解更多信息,请参阅$out 索引约束。

  • 如果对使用MongoDB Search 的集合进行重新分片,此操作会删除现有的搜索索引。分片操作完成后,您必须手动重建集合的搜索索引。

对于 M10+ 专用集群,Atlas 会从云备份快照恢复 MongoDB Search 索引定义。Atlas不会恢复搜索索引数据,因此 mongot 进程会对所有恢复的搜索索引定义执行初始同步。如果在集群上定义了大型搜索索引,则在快照恢复期间可能会遇到延迟。

是的,您可以使用CSFLE加密客户端在MongoDB 6.0及更高版本中对未加密数据运行MongoDB Search 查询。

不可以,您无法使用MongoDB Search查询CSFLE加密数据。

不可以,Queryable Encryption与MongoDB Search 不兼容。

不可以,您不能在时间序列集合上使用MongoDB Search。

是的,用户可以请求新功能,也可以使用MongoDB反馈对现有请求进行投票。

Yes, MongoDB Support can access your MongoDB Search infrastructure on both dedicated and co-located nodes, as well as download mongot logs from these nodes. However, you can block access for MongoDB Support at the organization level and then grant access to MongoDB Support for 24 hours if needed. To learn more, see Configure MongoDB Support Access.

不可以,但是您可以使用 $lookup$unionWith 在多个集合中运行搜索查询。要学习;了解更多信息,请参阅如何跨多个集合运行MongoDB搜索查询。