Fixed support for including document ids of related documents with document metadata.