Handle empty groups when reording doc collections

The document_ids parameter isn't sent with the request if one of the
document collection groups is empty. This change handles that
gracefully.