You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Umbraco.Cms.Integrations.Search.Algolia/readme.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ This integration provides a custom dashboard for managing search indices in Algo
5
5
## Prerequisites
6
6
7
7
Required minimum versions of Umbraco CMS:
8
-
- CMS: 10.1.0
8
+
- CMS: 10.3.1
9
9
- Algolia.Search: 6.13.0
10
10
11
11
## How To Use
@@ -59,3 +59,68 @@ From the dashboard you can also perform a search over one selected index, or rem
59
59
Two additional handlers for _ContentDeletedNotification_ and _ContentUnpublishedNotification_ will remove the matching object from Algolia.
60
60
61
61
Each Umbraco content item indexed in Algolia is referenced by the content entity's `GUID` Key field.
62
+
63
+
### Algolia record structure
64
+
An indexed Algolia record matching an Umbraco content item is composed of a default set of properties and a list of properties defined within the Umbraco dashboard.
65
+
66
+
Properties that can vary by culture will have a record property corespondent with this naming convention: `[property]-[culture]`.
67
+
68
+
The list of default properties consists of:
69
+
-`ObjectID` - `Guid` from the content item's `Key` property
70
+
-`Name` - with culture variants if any
71
+
-`CreateDate`
72
+
-`UpdateDate`
73
+
-`Url` - with culture variants if any
74
+
75
+
### Extending the Algolia indexing
76
+
Indexing the content for Algolia is based on the `IDataEditor.PropertyIndexValueFactory` property from the CMS, the indexed value of the property being retrieved using the `GetIndexValues` method.
77
+
78
+
The [`ContentBuilder`](https://github.com/umbraco/Umbraco.Cms.Integrations/blob/main/src/Umbraco.Cms.Integrations.Search.Algolia/Builders/ContentRecordBuilder.cs) is responsible for creating the record object that will be pushed to _Algolia_ and the [`AlgoliaSearchPropertyIndexValueFactory`](https://github.com/umbraco/Umbraco.Cms.Integrations/blob/main/src/Umbraco.Cms.Integrations.Search.Algolia/Services/AlgoliaSearchPropertyIndexValueFactory.cs) implementation of `IAlgoliaSearchPropertyIndexValueFactory` will returned the property value.
79
+
80
+
Current implementation contains a custom converter for the `Umbraco.MediaPicker3` property editor.
81
+
82
+
If a different implementation is required, you will need to follow these steps:
83
+
- inherit from `AlgoliaSearchPropertyIndexValueFactory`
84
+
- override the `GetValue` method
85
+
- add custom handlers to the [`Converters`](https://github.com/umbraco/Umbraco.Cms.Integrations/blob/fe5b17be519fff2c2420966febe73c8ed61c9374/src/Umbraco.Cms.Integrations.Search.Algolia/Services/AlgoliaSearchPropertyIndexValueFactory.cs#L26) dictionary
86
+
- register your implementation in the composer
87
+
88
+
#### Example
89
+
```
90
+
public class ExtendedAlgoliaSearchPropertyIndexValueFactory : AlgoliaSearchPropertyIndexValueFactory
91
+
{
92
+
private readonly IMediaService _mediaService;
93
+
94
+
public ExtendedAlgoliaSearchPropertyIndexValueFactory(IDataTypeService dataTypeService, IMediaService mediaService)
95
+
: base(dataTypeService, mediaService)
96
+
{
97
+
_mediaService = mediaService;
98
+
99
+
Converters = new Dictionary<string, Func<KeyValuePair<string, IEnumerable<object>>, string>>
0 commit comments