You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The feature described on this page is still part of the Foundation project, but it seems to have stopped working either in the latest version of Foundation or with the latest version(s) of Optimizely:
There seems to be multiple issues with the current code:
Setting up facets not working because Filter Type drop-down is empty
During site startup, Facets initialized before settings are initialized
During site startup, Settings initialization not working because they are not initialized in a HTTP request
Regarding 1:
Search Filter Configuration is located on the "Demo Settings Import" page. When I navigate to Search Settings, and I try to either create or modify an exiting filter, I can't select a FilterType, so I can't modify filter:
Regarding 2:
During site startup, facets are initialized in the Foundation.Infrastructure.InitializeSite class, in the ContextOnInitComplete() method. This method loads the current SearchSettings, but this is not initialized yet.
SearchSettings are initialized in the SettingsService.InitializeSettings() method, which is called from the Foundation.Infrastructure class in the ContentInstaller() method. But this is called after the ContextOnInitComplete() method listed above.
Regarding 3:
The site settings located on the "Demo Settings Import" page is used to store the Search Settings. This settings page is loaded during site initialization, based on the ContextOnInitComplete() method mentioned above. A part of this process, is to find the Settings page in the current site. This takes place in the Foundation.Infrastructure.Cms.Settings.SettingsService class, in the GetSiteSettings() method. This method calls the ResolveSiteId() method.
The ResolveSiteId method uses the _httpContextAccessor.HttpContext.Request metod to find the current hostname based on the current request. But there is no Http Request during site initialization, so this method finds no site. And therefore it finds no settings. So it can't initialize facets during startup.
Conclusion:
It looks as if there have been some changes to the site initialization flow, resulting in Facets not working.
The text was updated successfully, but these errors were encountered:
The feature described on this page is still part of the Foundation project, but it seems to have stopped working either in the latest version of Foundation or with the latest version(s) of Optimizely:
https://world.optimizely.com/blogs/calin-lupas/dates/2019/12/configurable-episerver-find-facets-by-editors/
There seems to be multiple issues with the current code:
Regarding 1:
Search Filter Configuration is located on the "Demo Settings Import" page. When I navigate to Search Settings, and I try to either create or modify an exiting filter, I can't select a FilterType, so I can't modify filter:
Regarding 2:
During site startup, facets are initialized in the Foundation.Infrastructure.InitializeSite class, in the ContextOnInitComplete() method. This method loads the current SearchSettings, but this is not initialized yet.
SearchSettings are initialized in the SettingsService.InitializeSettings() method, which is called from the Foundation.Infrastructure class in the ContentInstaller() method. But this is called after the ContextOnInitComplete() method listed above.
Regarding 3:
The site settings located on the "Demo Settings Import" page is used to store the Search Settings. This settings page is loaded during site initialization, based on the ContextOnInitComplete() method mentioned above. A part of this process, is to find the Settings page in the current site. This takes place in the Foundation.Infrastructure.Cms.Settings.SettingsService class, in the GetSiteSettings() method. This method calls the ResolveSiteId() method.
The ResolveSiteId method uses the _httpContextAccessor.HttpContext.Request metod to find the current hostname based on the current request. But there is no Http Request during site initialization, so this method finds no site. And therefore it finds no settings. So it can't initialize facets during startup.
Conclusion:
It looks as if there have been some changes to the site initialization flow, resulting in Facets not working.
The text was updated successfully, but these errors were encountered: