Navigation

Create an Atlas Search Index

Prerequisites

To create an Atlas Search index, you must have an Atlas cluster with:

  • MongoDB version 4.2 or higher
  • At least one collection

Procedure

1
2

Click the Collections button on your desired cluster.

3

Select a namespace from the left-side panel.

Select a database, then select a collection for your Atlas Search index.

4

Click the Search tab in the right-side panel.

5

Click the Create Search Index button.

6

Specify a name for the index in the Name field.

The index name defaults to default. You can leave the default name in place or choose one of your own.

Note

If you name your index default, you don’t need to specify an index parameter when using the $searchBeta pipeline stage. Otherwise, you must specify the index name using the index parameter.

Index names must be unique within their namespace.

Screenshot of Create an Atlas Search Index modal window
7

Define field mappings.

By default, the new index uses dynamic field mappings, which allows Atlas Search to dynamically assign data types to fields. You can leave the default index structure in place or define one of your own.

Note

Defining your own field mappings is recommended for advanced users only.

8

Click the Create Index button.

9

Close the In Progress Modal Window.

A modal window appears to let you know your index is building. Click the Close button.

9

Check the status.

The newly created index appears on the Search tab. While the index is building, the Status field reads Build in Progress. When the index is finished building, the Status field reads Active.

Note

Larger collections take longer to index. You will receive an email notification when your index is finished building.

Node Status

The Atlas Search tab in the right-side panel of the Atlas UI displays information about Atlas Search indexes for the selected namespace. The Status column shows the current state of the index on all the nodes of the cluster.

Screenshot of Atlas Search Index information panel

When the Status column reads Active, the index is ready to use. In other states, queries against the index may return incomplete results.

Status Description
Active The index is ready to use.
Build in Progress The index is building or re-building after an edit. If one node finishes building the index before the other cluster nodes, a message may appear that the nodes are in different states.
Delete in Progress Atlas is deleting the index from the cluster nodes.