Skip to content

Support sourcing list fields onto a nested element (with tracked __counts) #1266

Description

@ellisandrews-toast

Background

ElasticGraph's sourced_from feature lets a field on an indexed type be populated from a different source type's events, rather than from the indexed type's own events. #1252 extended this so a sourced_from field can live on a nested element of an indexed document, not just at the top level of the document.

Separately, ElasticGraph maintains a hidden __counts map on indexed documents to track the sizes of list fields. When a list field's contents change, ElasticGraph recomputes its count so that list-size-based queries stay correct.

Feature gap

Nested sourced_from currently supports sourcing scalar and object fields onto a nested element, but not list fields. In order to support sourcing nested list fields, the __counts tracking must work for these fields (there is currently no mechanism for this for the nested sourced field case).

Interim state

Until this is supported, a schema-dump-time validation will reject defining such a schema with a clear error pointing to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions