add get_doc_ids utility and tests