Skip to content

v3.0.0 NuGet Package - New index registration

Compare
Choose a tag to compare
@kentico-ericd kentico-ericd released this 26 Jul 16:57
· 34 commits to master since this release
c880963

Changes

  1. 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.

  1. IAlgoliaRegistrationService.RegisteredIndexes now contains a list of AlgoliaIndex objects (changed from RegisterAlgoliaIndexAttribute).
  2. IAlgoliaRegistrationService.GetAlgoliaIndexAttributes was removed.
  3. The parameters of IAlgoliaRegistrationService.RegisterIndex were changed to Type, 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.