TECHNOLOGY

Qdrant document grouping: stop one document from filling every result

In this article
THE QUICK TAKE

Deduplicating a truncated chunk list cannot recover documents excluded before grouping.

Document grouping in Qdrant answers a different question from returning the nearest chunks. Preserve the best supporting passages while limiting how many results one source occupies, rather than deduplicating an already truncated chunk list afterward.

Define the result unit

Decide whether the interface needs documents, passages or both. A chunk score refers to one indexed point, while a grouped result represents a source relationship recorded in payload. Stable document identifiers are therefore essential. Two files with similar names must not accidentally share an identifier, and different revisions need an explicit identity policy if the search is supposed to expose only current evidence.

Group inside the intended query

The multi-representation tutorial shows query_points_groups with document_id, including prefetch and fusion. Preserve that pipeline when comparing results. Application-side deduplication after a small chunk limit may discard duplicates without retrieving replacement documents. A short final list then reflects the earlier truncation, not necessarily a lack of relevant sources in the collection. Grouped search and post-hoc removal are not interchangeable experiments.

Build a duplicate-heavy fixture

Use an illustrative corpus in which one manual has several highly similar chunks and another document contains complementary evidence. Ask a question requiring both sources. Record the raw chunk ranking and the grouped output. Keep the same query vector, filters and evidence judgments. The desired improvement is source coverage under a stated result budget; it is not a promise that every second document deserves admission merely because it is different.

Result fieldMeaning
Group IDSource document identity
Supporting hitA passage justifying the result
Group countReturned source groups
Hit countReturned passages within groups

Keep prefetch depth visible

Qdrant’s hybrid-query reference describes how candidates feed later query stages. If the complementary document never enters prefetch, grouping cannot manufacture it. Compare candidate coverage before changing group settings. Increasing prefetch and enabling grouping together obscures which change recovered the missing evidence. Preserve both intermediate lists so the explanation remains available after tuning.

Validate the grouping field

Consult the indexing reference for the payload fields used by the selected operation. Inspect missing values, mixed types and accidental identifier reuse before judging relevance. A payload schema error can merge unrelated documents or leave some points outside the intended source relationship. Test a small set of known IDs and retain original file references alongside group labels; a readable label alone is not an auditable source key.

Judge evidence at the document level

A useful evaluation asks whether the returned sources jointly support the question and whether each supporting hit actually belongs to its group. Keep chunk-level relevance separately for diagnosing passage selection. Do not describe fewer duplicates as automatically better answers: diversity can also introduce irrelevant material. The acceptance record should preserve the result unit, grouping rules, candidate depth and held-out document judgments so a later interface change cannot silently redefine success.

Related reading: A local RAG server: placing components around the GPU; Qdrant for RAG: deciding what belongs in RAM or on disk.

← All articles