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

Feature: Algolia ISearchIndex Customization #17

Closed kentico-ericd closed 2 years ago

kentico-ericd commented 2 years ago

Motivation

Fixes #15 by adding a new IAlgoliaIndexService and a default implementation of DefaultAlgoliaIndexService which reproduces the existing behavior.

Developers can use decoration to get access to the IAlgoliaIndexService, or use the ISearchClient directly to generate a new index.

The latter approach also allows developers to target a different index per-environment, which isn't currently possible because index names have to be const string values on the index model.

This PR also addresses the following issues:

Checklist

How to test

No tests were added since the new abstraction has the exact same behavior as the existing code.

dotnet test