Filter parentFilter = context.filterCache().cache(parentDocMapper.typeFilter());
Filter childFilter = context.filterCache().cache(childDocMapper.typeFilter());
ParentChildIndexFieldData parentChildIndexFieldData = context.fieldData().getForField(parentFieldMapper);
ValuesSourceConfig<ValuesSource.Bytes.WithOrdinals.ParentChild> config = new ValuesSourceConfig<>(ValuesSource.Bytes.WithOrdinals.ParentChild.class);
config.fieldContext(new FieldContext(parentFieldMapper.names().indexName(), parentChildIndexFieldData, parentFieldMapper));
return new ParentToChildrenAggregator.Factory(aggregationName, config, parentType, parentFilter, childFilter);
}