|
| 1 | +# Umbraco.Forms.Integrations.Search.Algolia |
| 2 | + |
| 3 | +This integration provides a custom dashboard for managing search indices in Algolia. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Required minimum versions of Umbraco CMS: |
| 8 | +- CMS: 10.1.0 |
| 9 | +- Algolia.Search: 6.13.0 |
| 10 | + |
| 11 | +## How To Use |
| 12 | + |
| 13 | +### Authentication |
| 14 | + |
| 15 | +The communication with Algolia is handled through their [.NET API client](https://www.algolia.com/doc/api-client/getting-started/install/csharp/?client=csharp), |
| 16 | +which requires an Application ID and an API key. |
| 17 | +They are used to initialize the [`SearchClient`](https://github.com/algolia/algoliasearch-client-csharp/blob/master/src/Algolia.Search/Clients/SearchClient.cs) |
| 18 | +which handles indexing and searching operations. |
| 19 | + |
| 20 | +### Configuration |
| 21 | + |
| 22 | +The following configuration is required for working with the Algolia API: |
| 23 | + |
| 24 | +``` |
| 25 | +{ |
| 26 | + "Umbraco": { |
| 27 | + "CMS": { |
| 28 | + "Integrations": { |
| 29 | + "Search": { |
| 30 | + "Algolia": { |
| 31 | + "Settings": { |
| 32 | + "ApplicationId": "[your_application_id]", |
| 33 | + "AdminApiKey": "[your_admin_api_key]]" |
| 34 | + } |
| 35 | + } |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + } |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +### Working with the Umbraco CMS - Algolia integration |
| 44 | + |
| 45 | +In the backoffice, go to the _Settings_ section and look for the _Algolia Search Management_ dashboard. |
| 46 | + |
| 47 | +In this view you will be able to create definitions for indices in Algolia, by providing a name for the index and |
| 48 | +selecting the document types you want indexed, and which fields of the document types you want to include. |
| 49 | + |
| 50 | +After creating an index, only the content definition is saved into the _algoliaIndices_ table in Umbraco and an empty |
| 51 | +index is created in Algolia. |
| 52 | + |
| 53 | +The actual content payload is pushed to Algolia for indices created in Umbraco on two scenarios: |
| 54 | +- from the list of indices, the _Build_ action is triggered, resulting in all content of specific document types to be sent as JSON to Algolia. |
| 55 | +- using a _ContentPublishedNotification_ handler which will check the list of indices for the specific document type, and will update a matching Algolia object. |
| 56 | + |
| 57 | +From the dashboard you can also perform a search over one selected index, or remove it. |
| 58 | + |
| 59 | +Two additional handlers for _ContentDeletedNotification_ and _ContentUnpublishedNotification_ will remove the matching object from Algolia. |
| 60 | + |
| 61 | +Each Umbraco content item indexed in Algolia is referenced by the content entity's `GUID` Key field. |
0 commit comments