faq

For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!-- Tab options on this page. Append to the .md URL to filter: ?tabs=<id,...> select specific tabs (e.g. ?tabs=nodejs,shell) ?allTabs=true include every tab (no param) default: one tab per tabset

Available tabs: other tabs: fts-vs, data-explorer -->

No, there are no additional fees or charges when you enable MongoDB Search on your cluster. However, you might observe an increase in resource utilization on the cluster depending on factors such as the size of the indexed collections or index definitions. To manage and control MongoDB Search resource utilization, you can deploy [dedicated Search Nodes](https://www.mongodb.com/docs/search/deployment/deployment-options.md#std-label-what-is-search-node, which is an additive cost per node. We recommend this for your production environment.

See also:

  • [What is MongoDB Search?](https://www.mongodb.com/docs/search/index.md#std-label-what-is-fts

  • Search Node Costs

Can I run partial string matching MongoDB Search queries?

Yes. The following MongoDB Search operators support partial string matching queries:

  • [autocomplete](https://www.mongodb.com/docs/search/query/operators-collectors/autocomplete.md#std-label-autocomplete-ref

  • [wildcard](https://www.mongodb.com/docs/search/query/operators-collectors/wildcard.md#std-label-wildcard-ref

  • [regex](https://www.mongodb.com/docs/search/query/operators-collectors/regex.md#std-label-regex-ref

Can I perform case-insensitive search with the wildcard or regex operator?

Yes. You can use the [wildcard](https://www.mongodb.com/docs/search/query/operators-collectors/wildcard.md#std-label-wildcard-ref and [regex](https://www.mongodb.com/docs/search/query/operators-collectors/regex.md#std-label-regex-ref operators with a [custom analyzer](https://www.mongodb.com/docs/search/indexes/analyzers/custom.md#std-label-custom-analyzers to perform a case-insensitive search. You can define a [custom analyzer](https://www.mongodb.com/docs/search/indexes/analyzers/custom.md#std-label-custom-analyzers with the following tokenizer and token filter to perform a wildcard case-insensitive search:

  • [keyword](https://www.mongodb.com/docs/search/indexes/analyzers/tokenizers.md#std-label-keyword-tokenizer-ref tokenizer

  • [lowercase](https://www.mongodb.com/docs/search/indexes/analyzers/token-filters.md#std-label-lowercase-tf-ref token filter

Does storedSource support case-insensitive collation on fields?

Yes. The MongoDB Search [storedSource](https://www.mongodb.com/docs/search/indexes/stored-source-definition.md#std-label-fts-stored-source-definition option stores original values. To perform case-insensitive operations after the [$search](https://www.mongodb.com/docs/search/query/aggregation-stages/search.md#mongodb-pipeline-pipe.-search stage on the results returned using [returnStoredSource](https://www.mongodb.com/docs/search/query/return-stored-source.md#std-label-fts-return-stored-source-option option, you must set the default collation strength of your collection to 1 or 2 when you create it, and must not specify a different collation in your queries and indexes.

How do MongoDB Search indexes work on shards?

If you add shards to a collection with an existing MongoDB Search index, an initial sync occurs on the newly added shards for that MongoDB Search index. Each shard's MongoDB Search index contains only the documents from the collection that exists on that shard. To learn more, see Shard a Global Collection.

WARNING: If you shard a collection that already has a MongoDB Search index, you might experience a brief period of incomplete search results while the index is building on a shard. Also, if you add a shard for an already sharded collection that contains a MongoDB Search index, your search queries against that collection might return incomplete results until the initial sync process completes on the added shards. To learn more, see [initial sync process.](https://www.mongodb.com/docs/search/performance/index-performance.md#std-label-troubleshoot-initial-sync

Can I use the shard key to run MongoDB Search queries on specific shards?

No, you can't use the shard key to run MongoDB Search queries on a specific shard or a subset of shards. In a sharded cluster environment, MongoDB Search queries are scatter-gather queries that run on all the shards.

However, if you use [zones](https://www.mongodb.com/docs/manual/core/zone-sharding.md#std-label-zone-sharding to distribute a sharded collection over a subset of the shards in the cluster, MongoDB Search routes the query to the zone that contains the shards for the collection that you are querying and runs your [$search](https://www.mongodb.com/docs/search/query/aggregation-stages/search.md#mongodb-pipeline-pipe.-search queries on just the shards where the collection is located.

Do queries run on primary or secondary nodes?

By default, queries run on the primary node. You can configure your read preference or use replica set tags to specify read preference. To learn more, see [What is MongoDB Search?.](https://www.mongodb.com/docs/search/index.md#std-label-what-is-fts

Can I duplicate an index?

Yes, you can duplicate your index by performing the following:

  1. In Atlas, go to the Search & Vector Search page for your cluster.

You can go the MongoDB Search page from the Search & Vector Search option, or the Data Explorer.

### Search & Vector Search

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

If it's not already displayed, select your project from the Projects menu in the navigation bar.

In the sidebar, click Search & Vector Search under the Database heading.

  • If you have no clusters, click Create cluster to create one. To learn more, see [Create an Atlas Infinite or Atlas Core Cluster.](https://www.mongodb.com/docs/atlas/tutorial/create-new-cluster.md#std-label-create-new-cluster

  • If your project has multiple clusters, select the cluster you want to use from the Select cluster dropdown, then click Go to Search.

The Search & Vector Search page displays.

  1. Open the MongoDB Search index you want to update.

On the index you want to copy, click in the Action column.

Click Edit With JSON Editor.

  1. Copy the index.

  2. Create a new MongoDB Search index.

[Create a new index](https://www.mongodb.com/docs/search/indexes/manage-indexes.md#std-label-ref-create-index with the MongoDB Search JSON Editor. Paste the index you copied and click Create Search Index. You can make any edits you want directly in the MongoDB Search JSON Editor or MongoDB Search Visual Index Builder after you create the MongoDB Search index.

Note: Work in Progress

We are currently working on a solution for this that doesn't require the steps mentioned above. If you'd like to vote for this feature, or submit your feedback, use the MongoDB Feedback.

Does MongoDB Search store my entire index in memory?

No, MongoDB Search uses memory for the JVM heap metrics, which stores the autocomplete and text tokens of your search index. Similar to other database engines, MongoDB Search stores the majority of the index files on the disk, which benefits from the underlying OS page cache.

Why is my search index disappearing?

  • Verify that you entered the correct database and collection names. If you enter a non-existent database or collection name, the Atlas UI temporarily builds the index and deletes it shortly after.

  • If you use the $outs

  • If you [reshard](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-sharding-resharding a collection that uses MongoDB Search, this operation [removes](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-resharding-limitations existing search indexes. Once the sharding operation completes, you must manually rebuild your collection's search index.

Can I restore MongoDB Search indexes from Cloud Backup snapshots?

For M10+ dedicated clusters, Atlas restores MongoDB Search index definitions.

Does MongoDB Search work with CSFLE (Client-Side Field Level Encryption) encrypting clients?

Yes, you can use [CSFLE](https://www.mongodb.com/docs/manual/core/csfle.md#std-label-manual-csfle-feature encrypting clients to run MongoDB Search queries against non-encrypted data in MongoDB version 6.0 and later.

Can I query CSFLE (Client-Side Field Level Encryption) encrypted data?

No, you can't query [CSFLE](https://www.mongodb.com/docs/manual/core/csfle.md#std-label-manual-csfle-feature encrypted data using MongoDB Search.

No, [Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption.md#std-label-qe-manual-feature-qe is incompatible with MongoDB Search.

Can I use MongoDB Search on time series collections?

No, you can't use MongoDB Search on [time series](https://www.mongodb.com/docs/manual/core/timeseries-collections.md#std-label-manual-timeseries-landing collections.

Can I request new functionality?

Yes, use can request new functionality or upvote an existing request using the MongoDB Feedback.

Can MongoDB Support access my Search infrastructure and logs?

Yes, MongoDB Support can access your MongoDB Search infrastructure on both dedicated and co-located nodes, as well as download mongot logs from these nodes. However, you can block access for MongoDB Support at the organization level and then grant access to MongoDB Support for 24 hours if needed. To learn more, see Configure MongoDB Support Access.

How long are logs and diagnostic data stored for Search Nodes?

Atlas uploads Search Node logs and makes them available for download for diagnostics and incident mitigation. On the host, mongot deletes logs when they reach 2% of disk space utilization.

Logs and diagnostic data remain unavailable after you remove a Search Node from the cluster.

Can I run a [$search](https://www.mongodb.com/docs/search/query/aggregation-stages/search.md#mongodb-pipeline-pipe.-search query across multiple collections?

No, however, you can use [$lookup](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup.md#mongodb-pipeline-pipe.-lookup and [$unionWith](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith.md#mongodb-pipeline-pipe.-unionWith to run a search query across multiple collections. To learn more, see [How to Run MongoDB Search Queries Across Multiple Collections.](https://www.mongodb.com/docs/search/tutorial/cross-collection-tutorials.md#std-label-fts-cross-collection-tutorials