Added matching method to DocumentRepository