Skip to content

fix: qdrant - apply scale_score to grouped results and fix write progress bar - #4171

Open
Goodnight77 wants to merge 4 commits into
deepset-ai:mainfrom
Goodnight77:fix/qdrant-group-scale-score
Open

Goodnight77 wants to merge 4 commits into
deepset-ai:mainfrom
Goodnight77:fix/qdrant-group-scale-score

Conversation

@Goodnight77

Copy link
Copy Markdown

Related Issues

None, found while reading the Qdrant document store code.

Proposed Changes:

Two small fixes in QdrantDocumentStore.

  1. scale_score was ignored when group_by was set. The dense and sparse query paths (sync and async) passed grouped results to _process_group_results, which never applied score scaling, so users got raw scores back even with scale_score=True. _process_group_results now takes scale_score, flattens the group hits and reuses _process_query_point_results, so grouped and non-grouped queries scale scores the same way.

  2. The write progress bar overcounted. write_documents and write_documents_async advanced the bar by write_batch_size on every batch, including the last partial one, so writing 2 documents showed 100 items. The bar now advances by the actual batch length.

How did you test it?

  • Added a unit test for grouped queries with scale_score on and off. It fails without the fix.
  • Added sync and async unit tests checking the progress bar advances by [2, 1] for 3 documents with write_batch_size=2. They fail without the fix.
  • Ran the unit and integration test suites locally, all passing.
  • Manually checked grouped queries against an in-memory Qdrant collection, for both dense-only and sparse-enabled stores.
  • Ran fmt-check and mypy.

Notes for the reviewer

Hybrid retrieval is unchanged since it has no scale_score parameter.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title

@Goodnight77
Goodnight77 requested a review from a team as a code owner October 28, 2026 16:55
@Goodnight77
Goodnight77 requested review from julian-risch and removed request for a team October 28, 2026 16:55
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report (qdrant)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/qdrant/src/haystack_integrations/document_stores/qdrant
  document_store.py 1667-1669, 1732, 1926-1929, 1990-1993, 2588
Project Total  

This report was generated by python-coverage-comment-action

@HaystackBot

HaystackBot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Hi @Goodnight77, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from julian-risch October 28, 2026 18:27
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Oct 28, 2026
@HaystackBot
HaystackBot marked this pull request as draft October 28, 2026 18:27
@CLAassistant

CLAassistant commented Oct 28, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Goodnight77

Copy link
Copy Markdown
Author

@cla-assistant check

@Goodnight77
Goodnight77 marked this pull request as ready for review October 28, 2026 22:52
@HaystackBot HaystackBot removed the cla-pending PR is in draft until the contributor signs the CLA label Oct 28, 2026
@HaystackBot

Copy link
Copy Markdown
Contributor

Thanks for signing the CLA, @Goodnight77! 🎉 This PR is now ready for review again and the reviewer has been re-assigned.

@HaystackBot
HaystackBot removed the request for review from julian-risch October 29, 2026 09:51
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Oct 29, 2026
@HaystackBot
HaystackBot marked this pull request as draft October 29, 2026 09:51
@Goodnight77
Goodnight77 marked this pull request as ready for review October 29, 2026 09:57
@HaystackBot
HaystackBot marked this pull request as draft October 29, 2026 10:23
@Goodnight77
Goodnight77 marked this pull request as ready for review October 30, 2026 13:34
@HaystackBot
HaystackBot marked this pull request as draft October 30, 2026 13:51
@davidsbatista

Copy link
Copy Markdown
Contributor

@CLAassistant check

@davidsbatista davidsbatista removed the cla-pending PR is in draft until the contributor signs the CLA label Oct 30, 2026
@davidsbatista
davidsbatista marked this pull request as ready for review October 30, 2026 14:04
@davidsbatista
davidsbatista self-requested a review October 30, 2026 14:18
@HaystackBot
HaystackBot removed the request for review from davidsbatista October 30, 2026 14:51
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Oct 30, 2026
@HaystackBot
HaystackBot marked this pull request as draft October 30, 2026 14:51
@HaystackBot
HaystackBot marked this pull request as ready for review October 30, 2026 22:16
@HaystackBot HaystackBot removed the cla-pending PR is in draft until the contributor signs the CLA label Oct 30, 2026
@HaystackBot

Copy link
Copy Markdown
Contributor

Thanks for signing the CLA, @Goodnight77! 🎉 This PR is now ready for review again and the reviewer has been re-assigned.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants