v3.0.0 NuGet Package - New index registration
kentico-ericd
released this
26 Jul 16:57
·
34 commits
to master
since this release
Changes
- The recommended method for registering Algolia indexes is now to use a custom module in the Xperience administration project:
protected override void OnPreInit()
{
base.OnPreInit();
Service.Use<IAlgoliaIndexRegister>(new DefaultAlgoliaIndexRegister()
.Add<AlgoliaSiteSearchModel>(AlgoliaSiteSearchModel.IndexName)
);
}
and via a new parameter in the AddAlgolia
method in the live-site project:
// Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddAlgolia(Configuration,
new DefaultAlgoliaIndexRegister()
.Add<AlgoliaSiteSearchModel>(AlgoliaSiteSearchModel.IndexName)
);
}
The method of registering indexes via the RegisterAlgoliaIndex
attribute is still supported, but not recommended. Due to this change, the above methods must be called in both projects regardless of the index registration approach used.
IAlgoliaRegistrationService.RegisteredIndexes
now contains a list ofAlgoliaIndex
objects (changed fromRegisterAlgoliaIndexAttribute
).IAlgoliaRegistrationService.GetAlgoliaIndexAttributes
was removed.- The parameters of
IAlgoliaRegistrationService.RegisterIndex
were changed toType, string, IEnumerable<string>?
.
Bugfixes
- Installing the package on an Xperience instance that was hotfixed from a previous version to 13.0.73 worked as expected. However, installing the package on an Xperience instance using the Refresh 6 installer failed to build. Updating the
Kentico.Xperience.Libraries
reference to v13.0.73 resolves this issue.