Text Index Limitations and When to Use Atlas Search
Learners will identify the constraints of native text indexes—one per collection, language support—and decide when Atlas Search is a better choice.
Text Index Limitations Overview
MongoDB's built-in text index is a great starting point for full-text search, but it has several important limitations that become significant as your search requirements grow. Understanding these constraints helps you decide early whether to invest in the native text index or migrate to a dedicated search engine like Atlas Search.
One Text Index Per Collection
The most impactful limitation is that each collection can have only one text index. This means you cannot have separate text indexes for different search scenarios on the same collection—everything must be combined into a single index definition. If your search requirements change and you need to add or remove fields from the index, you must drop and rebuild the entire text index, which can be time-consuming on large collections.
// Can't have two text indexes on the same collection
db.articles.createIndex({ title: 'text' }); // OK
// db.articles.createIndex({ body: 'text' }); // ERROR!
// Must combine everything into one:
db.articles.dropIndex('title_text'); // rebuild required
db.articles.createIndex({ title: 'text', body: 'text' });All lessons in this course
- Creating a Text Index on String Fields
- Running $text Queries With Phrases and Negation
- Sorting by Text Score With $meta
- Text Index Limitations and When to Use Atlas Search