Local query_points_groups changes the top weighted RRF hit by expanding prefetch limits
Maintainers usually reply within 6 days
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design, databases
Research direction
Start with LocalCollection.query_groups and trace how it expands prefetch limits before fusion; compare that path with the server behavior described in the reproduction. Run the supplied Python fixture against local mode and Qdrant 1.20.2 over REST. Done means grouped and ungrouped queries return the same first result for the unique-group fixture while preserving grouping behavior with smaller limits or repeated group keys.
Written by the indexing model from the issue text.
Description
What happens
For the same weighted RRF query, a one-hit group per point changes which document is ranked first in Python local mode. A Qdrant 1.20.2 server over REST returns the same first document for grouped and ungrouped queries.
Checked against client dev commit d6d93e899a425c5f9ebd6c9f35ff6db77cc6b871, with Python 3.14 and a disposable server. The results below were identical across three fresh collections.
Reproduce
Point the URL argument at a disposable Qdrant 1.20.2 server (port 16333 here).
"""Run with a disposable Qdrant 1.20.2 server on port 16333."""
from uuid import uuid4
from qdrant_client import QdrantClient, models
name = f"weighted_rrf_{uuid4().hex[:8]}"
for mode, client in [
("local", QdrantClient(":memory:")),
("REST", QdrantClient(url="http://127.0.0.1:16333", check_compatibility=False, trust_env=False)),
]:
client.create_collection(
name,
vectors_config={
key: models.VectorParams(size=2, distance=models.Distance.DOT) for key in ("a", "b")
},
)
try:
client.upsert(
name,
[
models.PointStruct(id=i, vector={"a": [a, 0.0], "b": [b, 0.0]},
payload={"group": str(i)})
for i, (a, b) in enumerate([(1.0, 5.0), (5.0, 0.0), (4.0, 4.0), (2.0, 3.0)])
],
)
prefetch = [models.Prefetch(query=[1.0, 0.0], using=k, limit=3) for k in ("a", "b")]
query = models.RrfQuery(rrf=models.Rrf(weights=[1.0, 0.75]))
point = client.query_points(name, query=query, prefetch=prefetch, limit=1).points[0]
group = client.query_points_groups(
name, query=query, prefetch=prefetch, group_by="group", group_size=1, limit=1
).groups[0].hits[0]
print(mode, "points:", (point.id, round(point.score, 6)),
"groups:", (group.id, round(group.score, 6)))
finally:
client.delete_collection(name)
client.close()
| Mode | First ungrouped hit (ID, score) | First grouped hit (ID, score) |
|---|---|---|
| Python local | (2, 0.606061) | (1, 0.657895) |
| Server via REST | (2, 0.606061) | (2, 0.606061) |
Each point owns a distinct group and neither top result is tied. Point 1 ranks first in source A and last in source B, so source B's limit=3 normally excludes it. In the grouped local path, LocalCollection.query_groups raises each prefetch limit to the collection size before fusion. With the fixture above that includes point 1 in source B and raises it to the top.
Expected
With a unique group per point and a single group requested, this fixture should return the same top group in local mode and on the server. This is a grouped ranking difference, not just floating-point precision. I haven't proposed that all per-source limit expansion be removed: with smaller limits or repeated group keys the server can make additional grouping passes, so a fix needs to preserve that behavior.
AI disclosure: OpenAI Codex built and ran the local/REST reproduction and drafted this report.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 409
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/qdrant-client
-
Local listing queries silently accept a missing lookup_from collectionPossibly taken @SandeshKumar1 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
qdrant/qdrant-client#1729 · 1 comment ·
Maintainers usually reply within 6 days
-
url="qdrant:6333" raises "Unknown scheme: qdrant" when the scheme is left outPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
qdrant/qdrant-client#1712 ·
Maintainers usually reply within 6 days
-
Bug: _check_compatibility ignores verify parameter, causing SSL warnings with custom certificatesPossibly taken @industriverse claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
qdrant/qdrant-client#1693 · 1 comment ·
Maintainers usually reply within 6 days
-
Reciprocal rank fusion overwrites source scores and previous resultsPossibly taken @IlyaKhalafi claimed this 25 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
qdrant/qdrant-client#1680 ·
Maintainers usually reply within 6 days
-
IPv6 literal host: QdrantClient builds invalid REST URL and gRPC targetMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
qdrant/qdrant-client#1678 · 2 comments ·
Maintainers usually reply within 6 days
All issues in qdrant/qdrant-client
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Status: Triage Suggestion
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
collabnix/awesome-mcp-lists#515 ·
Maintainers usually reply within 1 day
-
Look-ahead bias via resample('1min').interpolate(method='time') in CCIStrategy and ReinforcedQuickieOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day