This repository was archived by the owner on Nov 10, 2025. It is now read-only.
Fixed the issue - limit parameter not working in QdrantVectorSearchTool #481
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.
🩹 Fix: QdrantVectorSearchTool returns only one result when limit > 1
Root Cause:
The query_points() method returns a QueryResponse object whose points attribute holds the list of ScoredPoint results.
However, when iterating directly over the search_result object, Pydantic’s BaseModel.iter yields key-value pairs (e.g. ('points', [points])).
As a result, the loop consumed only one iteration, producing a single record instead of the full result set.
Fix:
Iterate over search_result.points explicitly rather than over search_result itself:
❌ Before
for point in search_results:
result = {
"metadata": point[1][0].payload.get("metadata", {}),
"context": point[1][0].payload.get("text", ""),
"distance": point[1][0].score,
}
results.append(result)
✅ After
for point in search_results.points:
result = {
"metadata": point.payload.get("metadata", {}),
"context": point.payload.get("text", ""),
"distance": point.score,
}
results.append(result)
Outcome:
QdrantVectorSearchTool now respects the limit parameter and correctly returns all requested points.
Impact:
This fix ensures proper pagination and multi-result behavior in all vector search queries.