Skip to content

ToParentBlockJoinSortField does not handle missing values correctly #15548

@romseygeek

Description

@romseygeek

Description

I realised that as part of #15483 I'd made it impossible to set a missing value on ToParentBlockJoinSortField, so set about adding the functionality back in and adding some tests. This showed pretty quickly that the missing value functionality here doesn't really work in the way I'd expect.

The idea of this sort field is that you query parent documents, but order them by the 'best' value of their children. So a missing value should by rights be applied to a child document that doesn't have a value, as it's the children's values that are being used for ordering. However, what actually happens is that the missing value is used for parent documents that have either no children at all, or only children without sort values.

I think we should change this so that the missing value is propagated to the child sorters.

Version and environment details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions