Docs 菜单

Docs 主页入门指南

构建动态索引

In this guide, you will learn how to create an Atlas Search index with dynamic mappings to query and quickly retrieve relevant data.

所需时间:5 分钟

1
2
sample-data-cluster
3
1
2

单击 Create Search Index(连接)。

3

Select the Visual Editor configuration method, then click Next.

4

对于Database and Collection ,选择 sample_supplies数据库和salescollection。 然后,单击Next

5

Click Create Search Index to confirm your selection. Wait for the Status column to read Active.

You now have a search index that dynamically indexes the fields across the documents in your collection.

4
1

Click Query in the Actions column of your index definition.

2

Type notepad into the search bar, then click Search.

This query returns all documents in the sales collection with a field that contains notepad.

3

Your results should resemble the following sample documents:

SCORE: 0.20185701549053192
salesDate: 2013-03-07T09:27:58.283+00:00
items: Array
storeLocation: "Austin"
SCORE: 0.20185701549053192
salesDate: 2013-05-05T19:03:06.358+00:00
items: Array
storeLocation: "London"
SCORE: 0.20185701549053192
salesDate: 2016-06-20T14:09:52.408+00:00
items: Array
storeLocation: "Denver"

Each record also includes a relevance score. You can expand Array and Object fields to view their contents by clicking on them.

4

Click Edit Query Syntax. The modal window displays the query sent through the Atlas Search API.

If you successfully completed the procedure in this guide, you have created an Atlas Search index with dynamic field mappings and used it to perform a relevance-based query against the sample_supplies.sales collection. In the next guide, you will learn how to perform a refined search by creating an index with static field mappings.

接下来的步骤
使用静态字段映射建立索引
5 分钟

Retrieve documents in MongoDB with a field-specific query.

入门指南
第 3 章
Atlas Search
  • 构建动态索引
  • 使用静态字段映射建立索引
  • 使用复合运算符查询
  • 使用分面进行查询
入门指南 →