Fix indexMerger to respect the includeAllDimensions flag (#12428)