Fix GetDocumentIds OOM