Create Atlas Search Index

For this book's Full-Text Search Examples, you need to use an Atlas Cluster rather than a self-managed MongoDB deployment. The simplest way to provision an Atlas Cluster is to create a Free Tier Cluster. Once created, use the steps below whenever a Full-Text Search Examples chapter asks you to create a search index.


 

First, in the Atlas console for your database cluster, click the Search tab and then click Create Search Index:

Atlas Search - Create Index

 

Select JSON Editor and then click Next:

Atlas Search - JSON Editor

 

Leave Index Name as "default", select the database and collection you require, paste in your JSON index definition and then click Next:

Atlas Search - JSON definition

 

In the review screen, click Create Search Index to finish:

Atlas Search - Initial Review

It may take a few minutes for the system to generate the text search index.

 

Note that it is also possible for you to automate creating a search index by using the Atlas Admin API in MongoDB version 4.2 and greater, or by using the createSearchIndexes command in MongoDB version 7.0 and greater.