Skip to content

Conversation

@stellasia
Copy link
Contributor

@stellasia stellasia commented Dec 9, 2025

Description

Adds support for Qdrant payloads where the neo4j ID field is nested, for instance:

{
    'some_stuff': 'xxxxxxxxx',
    'metadata': {
        'uid': 'myUID',  # <- the ID we want to retrieve
    }
}

With this PR, users will be able to do this with:

    def my_id_getter(point: ScoredPoint) -> Any:
        if point.payload is None:
            raise Exception("Payload is None")
        return point.payload["metadata"]["uid"]

    retriever = QdrantNeo4jRetriever(
        driver=driver,
        client=client,
        collection_name="myColl",
        id_property_neo4j="uid",
        id_property_getter=my_id_getter,
    )

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Note

Please provide an estimated complexity of this PR of either Low, Medium or High

Complexity:

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@stellasia stellasia marked this pull request as ready for review December 9, 2025 11:15
@stellasia stellasia requested a review from a team as a code owner December 9, 2025 11:15
result_tuples.append(
[point.payload.get(self.id_property_external, point.id), point.score]
)
result_tuples.append([self.get_match_id_from_point(point), point.score])
Copy link
Contributor

@serengil serengil Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appends list instead of tuple into the variable result_tuples. do you mean something like:

result_tuples.append((self.get_match_id_from_point(point), point.score))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, updated in 468802b

Copy link
Contributor

@serengil serengil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stellasia stellasia merged commit d1291a0 into neo4j:main Dec 9, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants