@@ -37,6 +37,8 @@ public class AlgoliaContentCacheRefresherHandler : INotificationAsyncHandler<Con
37
37
38
38
private readonly IRecordBuilderFactory _recordBuilderFactory ;
39
39
40
+ private readonly IUmbracoContextFactory _umbracoContextFactory ;
41
+
40
42
public AlgoliaContentCacheRefresherHandler (
41
43
IServerRoleAccessor serverRoleAccessor ,
42
44
ILogger < AlgoliaContentCacheRefresherHandler > logger ,
@@ -46,7 +48,8 @@ public AlgoliaContentCacheRefresherHandler(
46
48
IUserService userService ,
47
49
IPublishedUrlProvider urlProvider ,
48
50
IAlgoliaSearchPropertyIndexValueFactory algoliaSearchPropertyIndexValueFactory ,
49
- IRecordBuilderFactory recordBuilderFactory )
51
+ IRecordBuilderFactory recordBuilderFactory ,
52
+ IUmbracoContextFactory umbracoContextFactory )
50
53
{
51
54
_serverRoleAccessor = serverRoleAccessor ;
52
55
_contentService = contentService ;
@@ -57,6 +60,7 @@ public AlgoliaContentCacheRefresherHandler(
57
60
_urlProvider = urlProvider ;
58
61
_algoliaSearchPropertyIndexValueFactory = algoliaSearchPropertyIndexValueFactory ;
59
62
_recordBuilderFactory = recordBuilderFactory ;
63
+ _umbracoContextFactory = umbracoContextFactory ;
60
64
}
61
65
62
66
public async Task HandleAsync ( ContentCacheRefresherNotification notification , CancellationToken cancellationToken )
@@ -103,7 +107,7 @@ protected async Task RebuildIndex(IEnumerable<IContent> entities)
103
107
. FirstOrDefault ( p => p . ContentType . Alias == entity . ContentType . Alias ) ;
104
108
if ( indexConfiguration == null || indexConfiguration . ContentType . Alias != entity . ContentType . Alias ) continue ;
105
109
106
- var record = new ContentRecordBuilder ( _userService , _urlProvider , _algoliaSearchPropertyIndexValueFactory , _recordBuilderFactory )
110
+ var record = new ContentRecordBuilder ( _userService , _urlProvider , _algoliaSearchPropertyIndexValueFactory , _recordBuilderFactory , _umbracoContextFactory )
107
111
. BuildFromContent ( entity , ( p ) => indexConfiguration . Properties . Any ( q => q . Alias == p . Alias ) )
108
112
. Build ( ) ;
109
113
0 commit comments