Troubleshooting
On this page
- Cannot use the
$vectorSearch
stage on Atlas cluster - In Atlas, go to the Clusters page for your project.
- Slow queries
$vectorSearch
returns no resultsError during document retrieval
when using filtering with LangChainCommand not found
when creating Atlas Vector Search index- Unable to filter on a given field
This document provides advice for troubleshooting problems with Atlas Vector Search. For direct assistance with Atlas Vector Search issues, you can either start a discussion on the MongoDB Developer Community or contact support.
Cannot use the $vectorSearch
stage on Atlas cluster
To use the $vectorSearch
pipeline stage to query your cluster,
your cluster must run MongoDB 6.0.11+ or 7.0.2+. If you invoke
$vectorSearch
on an incompatible version of MongoDB, you might see
the following error:
OperationFailure: $vectorSearch is not allowed with the current configuration. You may need to enable the corresponding feature flag.
To check the MongoDB version of your cluster:
In Atlas, go to the Clusters page for your project.
If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
If the Clusters page is not already displayed, click Database in the sidebar.
Locate the information pane of the cluster you want
to use $vectorSearch
on.
Consult the Version number in the bottom section of the information pane.
If your cluster runs a version of MongoDB earlier than 6.0.11 or 7.0.2, you must upgrade the MongoDB version of the cluster.
Slow queries
For recommendations on improving query performance, see Improve Vector Search Performance.
$vectorSearch
returns no results
If $vectorSearch
queries return no results, ensure that you use the
same text embedding model to embed both your data and your query. If
you embed your query using a different model than you use to embed
your data, $vectorSearch
can't identify matches.
Error during document retrieval
when using filtering with LangChain
When you use LangChain to perform RAG with pre-filtering, you might encounter the following error:
Error during the document retrieval or generation process: MongoServerError: PlanExecutor error during aggregation :: caused by :: Path 'field' needs to be indexed as token
If an index on field
exists, ensure you have created this index as
an Atlas Vector Search index, not an Atlas Search index. If no index on field
exists, create one. To learn more about
implementing RAG with Atlas Vector Search and LangChain, see
Answer Questions on Your Data.
Command not found
when creating Atlas Vector Search index
When you attempt to create an Atlas Vector Search index programmatically, you
might encounter a Command not found
error. This error occurs for
one of two reasons:
You run the command against an Atlas cluster running a version of MongoDB earlier than 6.0.11 or 7.0.2. In this case, you must upgrade the MongoDB version of the cluster to enable Atlas Vector Search for the cluster.
You run the command against an
M0
Free Tier cluster. In this case, as long as the cluster is running a compatible MongoDB version, you can create an Atlas Vector Search index with the Atlas UI.
Unable to filter on a given field
Atlas Vector Search currently supports filtering only on fields with boolean, numeric, or string values.