Here are all the actual test exam dumps for IT exams. Most people prepare for the actual exams with our test dumps to pass their exams. So it's critical to choose and actual test pdf to succeed.

Exam AI-200 Topic 1 Question 8 Discussion

Actual exam question for Microsoft's AI-200 exam
Question #: 8
Topic #: 1
You store embeddings in a property named embedding in an Azure Cosmos DB for NoSQL container.
You must construct a vector similarity query that orders documents by similarity to the input embedding and returns only the top five results.
You need to construct the similarity query.
What should you do?

Suggested Answer: B Vote an answer

The query should limit the number of returned results by using TOP 5 together with ORDER BY VectorDistance(...) . Azure Cosmos DB for NoSQL provides the VectorDistance() system function for comparing a stored vector with an input query vector. Microsoft documents that a vector similarity query should order the results by VectorDistance so that the nearest matches are returned first.
A representative query is:
SELECT TOP 5
c.id,
VectorDistance(c.embedding, @embedding) AS SimilarityScore
FROM c
ORDER BY VectorDistance(c.embedding, @embedding)
Microsoft specifically recommends using a TOP N clause for vector search queries because returning more results than necessary increases RU consumption and latency. In this scenario, TOP 5 directly satisfies the requirement to return only the five most similar documents.
GROUP BY is used for aggregation and does not rank vectors by similarity. DISTINCT removes duplicate projected values but does not restrict results to the five nearest vectors. Offset pagination is unnecessary and can introduce additional query cost when only the highest-ranked five results are required.
Therefore, the correct action is to limit the number of results .
Study Guide references: Azure Cosmos DB for NoSQL # VectorDistance() ; vector search; ORDER BY ; TOP N ; RU and latency optimization.

by Valentine at Nov 10, 2026, 07:22 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.