integrate `DescriptorIndexCollector` in a fully backward-compatible way

Adapt the alpha implementation from release 1.4.0, ticket #19791 (moved).

See comments 10 to 12 in #19791 (moved) for background.