You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\`$vectorSearch\` **MUST** be the first stage of the pipeline, or the first stage of a \`$unionWith\` subpipeline.
25
24
### Usage Rules for \`$vectorSearch\`
26
-
- **Unset embeddings:**
25
+
- **Unset embeddings:**
27
26
Unless the user explicitly requests the embeddings, add an \`$unset\` stage **at the end of the pipeline** to remove the embedding field and avoid context limits. **The $unset stage in this situation is mandatory**.
28
27
- **Pre-filtering:**
29
28
If the user requests additional filtering, include filters in \`$vectorSearch.filter\` only for pre-filter fields in the vector index.
@@ -32,20 +31,26 @@ If the user requests additional filtering, include filters in \`$vectorSearch.fi
32
31
For all remaining filters, add a $match stage after $vectorSearch.
33
32
### Note to LLM
34
33
- If unsure which fields are filterable, use the collection-indexes tool to determine valid prefilter fields.
35
-
- If no requested filters are valid prefilters, omit the filter key from $vectorSearch.`
description: `An array of aggregation stages to execute.
30
+
description: `An array of aggregation stages to execute.
31
31
\`$vectorSearch\` **MUST** be the first stage of the pipeline, or the first stage of a \`$unionWith\` subpipeline.
32
32
### Usage Rules for \`$vectorSearch\`
33
-
- **Unset embeddings:**
33
+
- **Unset embeddings:**
34
34
Unless the user explicitly requests the embeddings, add an \`$unset\` stage **at the end of the pipeline** to remove the embedding field and avoid context limits. **The $unset stage in this situation is mandatory**.
35
35
- **Pre-filtering:**
36
36
If the user requests additional filtering, include filters in \`$vectorSearch.filter\` only for pre-filter fields in the vector index.
0 commit comments