Hi!
I have a small question about a multilingual site in Umbraco with variants. I want to send my content to Azure Search when it is published, so my idea was to use the ContentPublishedNotification and the ContentMovingToRecycleBinNotification and ContentUnpublishingNotification to detect when the content needs to be removed or updated in Azure Search.
The problem is that Azure Search requires a unique key to identify the content. Since the content ID is the same across all published cultures, I also need to use the culture of the content to create a unique ID that can be referenced back to Umbraco content. However, within the ContentPublishedNotification, I can't find a way to get the culture of the published content. Does anyone know a trick to obtain this information? Or perhaps another idea that would achieve the same result?
Thank you!
Rick
07/31/2024, 10:03 AM
For people who are currently also don't know how to do this. I found a way in the documentation of Umbraco:
foreach (var entity in notification.PublishedEntities)
{
// Cultures being saved
var savingCultures = entity.AvailableCultures
.Where(culture => notification.HasPublishedCulture(entity, culture)).ToList();
}
https://docs.umbraco.com/umbraco-cms/reference/notifications/contentservice-notifications