This tutorial describes how to create an index on the
sample_mflix.movies collection and run partial string queries
plot field. To return matches for partial string
queries, you can use one of the following operators:
The autocomplete operator, which allows you to search the specified fields for a word or phrase that contains the sequence of characters that you specify with your query.
The phrase operator, which allows you to search the specified fields for documents that contain the terms in your query string at the distance you specify between the terms.
The regex operator, which allows you to search the specified fields for strings using regular expression.
The wildcard operator, which allows you to search the specified fields using special characters in your query to match any character.
This tutorial takes you through the following steps:
Set up an Atlas Search index on the
plotfield in the
Before you begin, ensure that your Atlas cluster meets the requirements described in the Prerequisites.
To create an Atlas Search index, you must have
Project Data Access Admin or higher access to the project.
In this section, you will create an Atlas Search index on the
sample_mflix.movies collection for running partial match
queries against those fields.
If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
Click your cluster's name.
Click the Atlas Search tab.
In the Index Name field, enter
If you name your index
default, you don't need to specify an
indexparameter when using the $search pipeline stage. Otherwise, you must specify the index name using the
In the Database and Collection section, find the
sample_mflixdatabase, and select the
➤ Use the Select your language drop-down menu on this page to set the language of the examples in this section.
You can use the autocomplete, phrase, regex, and wildcard operators to run a case-sensitive partial match query. This tutorial uses these operators to search for movies whose plot contain the specified partial string.
In this section, you will connect to your Atlas cluster and run the
sample query using the operator against the
plot field in the