Docs Menu

Run Atlas Search Queries

Atlas Search queries are run as an aggregation pipeline stage. If you have an existing Atlas Search Index for data on your Atlas cluster, you can run $search and $searchMeta queries. If you have an existing Atlas Vector search index on your data in Atlas, you can also run $vectorSearch queries.

Create an Atlas Search index or an Atlas Vector Search index.

Note

Atlas Search index management in the Compass UI is available only for:

  • Atlas local deployments.

  • Deployments running MongoDB 7.0 or later.

1

From the Indexes tab, click Search Indexes. Hover over the search index you want to use in your query.

2

Click the Aggregate button that appears when you hover over your search index.

3

By default, MongoDB Compass selects the $search stage for your query. You can also select the $searchMeta stage to use in your query. If you are using a vectorSearch type index in your query, you can use the $vectorSearch stage.

Note

If you use the $search, $searchMeta, or $vectorSearch stage, it must be the first stage in your aggregation pipeline. To combine vector and full-text search in the same pipeline, perform a hybrid search. For more information, see How to Perform Hybrid Search.

4