Kentico / xperience-algolia

Enables the creation of Algolia search indexes and the indexing of Xperience content tree pages using a code-first approach.
https://www.kentico.com
MIT License
1 stars 3 forks source link

Enable index name customization #24

Closed kentico-ericd closed 2 years ago

kentico-ericd commented 2 years ago

Motivation

Implements #22

Checklist

How to test

Manually register Algolia indexes using the new approach described here, e.g.

protected override void OnPreInit()
{
    base.OnPreInit();

    var environment = ConfigurationManager.AppSettings["Environment"];
    Service.Use<IAlgoliaIndexRegister>(new DefaultAlgoliaIndexRegister()
        .Add<AlgoliaSiteSearchModel>($"{environment}-{AlgoliaSiteSearchModel.IndexName}")
    );
}

and ensure that the indexing/search functionality is working as expected. Indexes using the RegisterAlgoliaIndex attribute should still work as expected.