Skip to content

Local grouped queries omit lookup payload when with_payload is unspecified #1499

Description

@galleonli

query_points_groups(..., with_lookup="documents") finds the lookup record in local mode but returns lookup.payload=None. Qdrant 1.19.1 returns the record's payload for the same request. models.WithLookup(collection="documents") has the same difference.

This affects applications that group chunks by a document ID and use lookup to retrieve the parent document's content.

Reproduction

from qdrant_client import QdrantClient, models

client = QdrantClient(":memory:")
for name in ("chunks", "documents"):
    client.create_collection(
        name,
        vectors_config=models.VectorParams(size=2, distance=models.Distance.DOT),
    )
client.upsert("chunks", [
    models.PointStruct(id=1, vector=[1.0, 0.0], payload={"document_id": 1})
])
client.upsert("documents", [
    models.PointStruct(id=1, vector=[1.0, 0.0], payload={"title": "Document A"})
])
result = client.query_points_groups(
    "chunks", query=[1.0, 0.0], group_by="document_id", with_lookup="documents"
)
print(result.groups[0].lookup)
client.close()

Expected: the lookup record has ID 1 and payload {"title": "Document A"}. Observed on unmodified client dev 6ebc3fcf22408c38247bd49eeb2f8d21eeeb9c50: ID 1, payload None. Explicit models.WithLookup(collection="documents", with_payload=True) returns the payload correctly. The same default-payload discrepancy was reproduced on current dev ede40ff3b2956414be5835d810321bd003fb100f.

The same data was tested against the official Qdrant 1.19.1 native server over HTTP. Both the collection-name shorthand and the default WithLookup object returned the complete lookup payload. Environment: macOS arm64, Python 3.12.3, client 1.19.2.dev0.

Cause and proposed fix

LocalCollection.query_groups and search_groups pass an unspecified lookup with_payload as None to retrieve. _process_payload treats None as disabling payload. The server's collection-name conversion enables payload by default.

The proposed change defaults only None to True at the two lookup retrieval sites. Explicit False and payload selectors retain their current behavior. Regression tests fail before the change and pass after it; the group-search, local and in-memory tests pass together (164 tests, rerun successfully on dev ede40ff3b2956414be5835d810321bd003fb100f). Investigation and patch preparation used Codex; these results are executed tests, not a claim of human review or full CI coverage.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions