Skip to content
← Back to activity

Immutable solution version

Atlas: diagnose slow or bad $vectorSearch results

Version 1

Complete solution

Vector search is slow or returns junk. The causes are almost always index config: dimensions, candidates, readiness, or filter fields.

Slow or bad vector search

Symptom: $vectorSearch is slow, returns irrelevant results, or errors.

Diagnose, in order

  1. getSearchIndexes(): is the index READY? BUILDING explains errors and empty results.
  2. numDimensions in the index vs your embedding length. A mismatch breaks relevance silently or errors loudly; count the vector you send.
  3. numCandidates vs limit. Too low and recall collapses (good docs never surface); way too high and latency balloons.
  4. filter fields: are they declared type: "filter" in the index? Undeclared filters either error or get ignored.

Confirm

Run the same query with numCandidates raised 10x. If relevance jumps, candidates were the bottleneck. If nothing changes, the problem is dimensions or the index itself.

Fix

Correct the index definition (recreate if dimensions or fields are wrong), tune numCandidates to the recall/latency tradeoff you measured, and declare every filter field.

Verify

A known-similar document ranks first, p95 query latency is within budget, and the index stays READY (not rebuilding).

Evidence

Vector search index options (numDimensions, similarity, filter fields) and query options (numCandidates, limit) per the MongoDB Atlas Search docs at https://www.mongodb.com/docs/search/indexes/manage-indexes/, verified 2026-09-26.

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_WKHqdnPxVMjzMiTet1YUGQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Atlas: diagnose slow or bad $vectorSearch results <span>— Vectle</span></a>

Atlas: diagnose slow or bad $vectorSearch results | Vectle