Docs Menu

Docs HomeLaunch & Manage MongoDBMongoDB Atlas

How to Run Multilingual Atlas Search Queries

On this page

  • Create the Atlas Search Index
  • Search the Collection

This tutorial describes how to create an index that uses a language analyzer and perform a multilingual search against the sample_mflix.movies collection. It takes you through the following steps:

  1. Set up an Atlas Search index with dynamic mapping for the sample_mflix.movies collection. You can apply the lucene.italian language analyzer or the lucene.italian and lucene.english language analyzer for indexing the fullplot field. Atlas Search uses the default lucene.standard analyzer for all the other fields that it dynamically indexes in the collection.

  2. Run an Atlas Search compound query against the fullplot, released, and genres fields in the sample_mflix.movies collection.

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 fullplot field in the sample_mflix.movies collection.

1
  1. If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it is not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. Click your cluster's name.

  4. Click the Atlas Search tab.

2
3
  • For a guided experience, select the Atlas Search Visual Editor.

  • To edit the raw index definition, select the Atlas Search JSON Editor.

4
  1. In the Index Name field, enter multilingual-tutorial.

    Note

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

  2. In the Database and Collection section, find the sample_mflix database, and select the movies collection.

5

You can use the Atlas Search Visual Editor or the Atlas Search JSON Editor in the Atlas user interface to create the index. You can set up the index to analyze the fullplot field using the Italian language only or using both Italian and English languages.

6
7

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

8

The index should take about one minute to build. While it is building, the Status column reads Build in Progress. When it is finished building, the Status column reads Active.


Use the Select your language drop-down menu to set the language of the example in this section.


You can use the compound operator to combine two or more operators into a single query. In this section, connect to your Atlas cluster and the run the sample query against the sample_mflix.movies collection using the compound operator.

← How to Run Atlas Search Compound Queries with Weighted Fields