Rosen Petrov
01/31/2025, 8:13 AMLewis Heaton
01/31/2025, 8:25 AMRosen Petrov
01/31/2025, 8:34 AMSearchConfiguration? searchConfiguration = _siteConfigurationProvider.GetSearchConfigurationByContent(content);
https://cdn.discordapp.com/attachments/1334798793601847296/1334803960678322267/StoreComputedFieldsValuesInIndex.cs?ex=679ddc8f&is=679c8b0f&hm=ebd2146586c64f54dd47fbc0efb12ef87f5f5d51ce9e7ab454c592dffd98c977&Rosen Petrov
01/31/2025, 8:39 AMpublic SiteConfiguration GetByContent(IPublishedContent content)
{
ArgumentNullException.ThrowIfNull(content);
switch (content.ContentType.ItemType)
{
case PublishedItemType.Content:
{
return GetByContentRootAlias(content.Root().ContentType.Alias);
}
case PublishedItemType.Media:
{
return GetByMediaRootKey(content.Root().Key); // returns wrong Key and I cannot get my proper SiteConfiguration because I rely on the Root key here
}
case PublishedItemType.Unknown:
case PublishedItemType.Element:
case PublishedItemType.Member:
default:
{
throw new SiteConfigurationException($"SiteSearchConfiguration cannot be found by '{content.ContentType.ItemType}' content type");
}
}
}