New in version 1.40.0.在版本1.40.0中新增。
You can create Atlas Search indexes in MongoDB Compass. Atlas Search indexes let you query data in Atlas Search. Atlas Search indexes enable performant text search queries by mapping search terms to the documents that contain those terms.您可以在MongoDB Compass中创建Atlas搜索索引。Atlas Search索引允许您在Atlas Search中查询数据。Atlas搜索索引通过将搜索词映射到包含这些词的文档,实现了高性能的文本搜索查询。
About this Task关于此任务
To create an Atlas Search index, your deployment must be either:要创建Atlas搜索索引,部署必须是:
Hosted on MongoDB Atlas and have an Atlas cluster tier of M10 or higher.托管在MongoDB Atlas上,Atlas集群层为M10或更高。A local deployment that is set up using the Atlas CLI.使用Atlas CLI设置的本地部署。
Additionally, your deployment must run MongoDB version 7.0 or later.此外,部署必须运行MongoDB 7.0或更高版本。
Procedures过程
Create an Index创建索引
Open the index creation dialog打开索引创建对话框
From the Indexes tab, click the Create button, then click Search Index.在“索引”选项卡中,单击“创建”按钮,然后单击“搜索索引”。
Specify the search index definition指定搜索索引定义
Compass provides templates for different kinds of search indexes. To learn more, see Search Index Definition Syntax.Compass为不同类型的搜索索引提供了模板。要了解更多信息,请参阅搜索索引定义语法。
Example示例
The following example definition creates a search index that indexes all fields:以下示例定义创建了一个对所有字段进行索引的搜索索引:
{
mappings: { dynamic: true }
}Results结果
To view the status of your created index, go to the Indexes tab and set the toggle at the top-right to Search Indexes.要查看创建的索引的状态,请转到“索引”选项卡,并将右上角的切换设置为“搜索索引”。
The Status column indicates the status of the index. When the status is Ready, your index is ready to be used.“状态”列指示索引的状态。当状态为“就绪”时,索引已准备好使用。
For more information on search index statuses, see MongoDB Search Index Statuses.有关搜索索引状态的更多信息,请参阅MongoDB搜索索引状态。