Fix cosmosSearch vector field name: query -> vector#24
Merged
Conversation
The cosmosSearch operator in Azure DocumentDB's $search aggregation stage takes the query embedding under the �ector field, not query. The previous examples would fail at runtime (or silently return wrong results depending on server version), and the agent surfaces these files verbatim when generating vector-search code. Fixes three occurrences: - skills/vector-search/vector-knn-query.md (both the incorrect and correct examples) - skills/full-text-search/fts-hybrid-search.md (vector arm of the hybrid example) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
xgerman
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
cosmosSearchoperator in Azure DocumentDB's `` aggregation stage takes the query embedding under thevectorfield, not `query`. The current vector-search examples use `query:` which is invalid syntax — queries built from these examples will fail at runtime (or silently return wrong results, depending on server build).This is high-impact because
skills/vector-search/vector-knn-query.mdis the canonical example the agent surfaces for any ""how do I do vector search?"" prompt, so the agent currently generates broken queries by default.Changes
Three call sites fixed:
skills/vector-search/vector-knn-query.md(incorrect example)query: qvvector: qvskills/vector-search/vector-knn-query.md(correct example)query: queryVectorvector: queryVectorskills/full-text-search/fts-hybrid-search.md(vector arm of hybrid)query: qvvector: qvReference
Per the official Azure DocumentDB / Cosmos DB for MongoDB vCore vector-search docs, the
cosmosSearchoperator shape is:Validation
pwsh scripts/validate-skills.ps1still passes (17/17).rg ""cosmosSearch:.*query:""returns no remaining hits.