Creating an Atlas Search Index
Learners will define a search index mapping in the Atlas UI or via the API and understand how Lucene tokenises and stores field values.
What Is Atlas Search?
Atlas Search is a fully managed, Apache Lucene-based search engine embedded directly into MongoDB Atlas. Unlike MongoDB's native text indexes, Atlas Search provides relevance scoring, fuzzy matching, autocomplete, faceted navigation, and sophisticated analyzers—all accessible through an aggregation pipeline stage called $search. You do not need to run a separate Elasticsearch or Solr cluster; Atlas Search lives alongside your data.
How Atlas Search Works Under the Hood
Atlas Search runs a Lucene engine as a separate process alongside each MongoDB node. When documents are inserted, updated, or deleted, MongoDB streams the changes to the Lucene index asynchronously. This means Atlas Search indexes are eventually consistent with the MongoDB data—there is a small lag (typically milliseconds) between a write and its appearance in search results. For most applications this is perfectly acceptable.
All lessons in this course
- Creating an Atlas Search Index
- Writing $search Queries: Text, Phrase, and Wildcard
- Autocomplete and Fuzzy Matching
- Facets and Compound Queries