To assign or update roles for existing documents, you can use the Azure Cognitive Search SDK or API to retrieve the document, update the roles field, and reindex the document into Azure Cognitive Search.