Atlas error: $vectorSearch index not found
The query names an index that does not exist, is the wrong type, or is still building. Check getSearchIndexes before touching the query.
TL;DR: The query names an index that does not exist, is the wrong type, or is still building. Check getSearchIndexes before touching the query. Confirm Run db.[collection].getSearchIndexes(). Check three things: 1.
The error
index not foundThe fix
- The name matches exactly, including case.
- The
typeisvectorSearch, notsearch. A full-text index cannot serve$vectorSearch.
- The
statusisREADY.BUILDINGorFAILEDexplains everything.
- Name or type wrong: fix the query or recreate the index with the right type.
- Still building: wait. Poll
getSearchIndexes()until READY. Large collections take a while.
- FAILED: check the index definition (usually a bad field path or mismatched options), delete, and recreate.
When to use this
- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: Atlas error.
- You want the fastest verified fix before digging through logs.
When not to use this
- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.
Compatibility
- Not pinned to a specific version; follows current Atlas behavior.
Also seen as
FAILED
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.