Ekom.Algolia
0.2.35
dotnet add package Ekom.Algolia --version 0.2.35
NuGet\Install-Package Ekom.Algolia -Version 0.2.35
<PackageReference Include="Ekom.Algolia" Version="0.2.35" />
<PackageVersion Include="Ekom.Algolia" Version="0.2.35" />
<PackageReference Include="Ekom.Algolia" />
paket add Ekom.Algolia --version 0.2.35
#r "nuget: Ekom.Algolia, 0.2.35"
#:package Ekom.Algolia@0.2.35
#addin nuget:?package=Ekom.Algolia&version=0.2.35
#tool nuget:?package=Ekom.Algolia&version=0.2.35
Ekom.Algolia
Algolia integration plugin for Ekom (Umbraco).
Features
- Product indexing with background queue/worker.
- Category indexing with background queue/worker.
- Standard Umbraco content indexing with background queue/worker.
- Product search service with Algolia SDK
SearchForHitsrequests. - Category search service with Algolia SDK
SearchForHitsrequests. - Standard content search and federated multi-index search.
- Algolia Insights events for view, add-to-cart, checkout, purchase.
- In-memory search result caching with store-scoped invalidation after reindex/update/delete.
- Index naming convention:
{primary|replica|query_suggestions}.ENVIRONMENT.STORE.ENTITY[_sorted_by_{asc|desc}_ATTRIBUTE][.Locale][.Currency].
Install
Register services:
using Ekom.Algolia;
services.AddAlgolia();
Search products:
using Algolia.Search.Models.Search;
using Ekom.Algolia.Models.Search;
using Ekom.Algolia.Services;
public sealed class ProductSearchController
{
private readonly IAlgoliaSearchService _algoliaSearchService;
public ProductSearchController(IAlgoliaSearchService algoliaSearchService)
{
_algoliaSearchService = algoliaSearchService;
}
public async Task<IReadOnlyList<string>> SearchAsync(CancellationToken ct)
{
var response = await _algoliaSearchService.SearchProductsAsync(
new AlgoliaSearchRequest
{
StoreAlias = "Store",
Locale = "en-US",
Currency = "USD",
Query = new SearchForHits
{
Query = "shoe",
HitsPerPage = 20,
Filters = "Available:1"
}
},
ct).ConfigureAwait(false);
return response.Hits.Select(x => x.Title).ToList();
}
}
Configuration (appsettings.json)
{
"Ekom": {
"Algolia": {
"Enabled": true,
"ApplicationId": "APP_ID",
"AdminApiKey": "ADMIN_API_KEY",
"SearchApiKey": "SEARCH_API_KEY",
"InsightsApiKey": "INSIGHTS_API_KEY",
"AnalyticsRegion": "eu",
"Environment": "prod",
"Indexing": {
"Enabled": true,
"Products": true,
"Categories": true,
"Variants": false,
"BatchSize": 1000,
"ProductProperties": [
"title",
"summary",
"description",
"channels|array",
"stockCount|int",
"weight|decimal",
"publishedAt|unix"
],
"Dispatching": {
"MaxBatchSize": 100,
"FlushIntervalSeconds": 2,
"MaxQueueSize": 10000,
"MaxConcurrency": 2
}
},
"ContentIndexing": {
"Enabled": true,
"EnforcePublisherOnly": true,
"BatchSize": 1000,
"Indexes": [
{
"IndexName": "SearchIndex",
"ContentTypes": [
{
"Alias": "article",
"Properties": [
"title",
"summary",
"publishedAt|unix"
]
}
]
}
]
},
"Search": {
"Enabled": true,
"Products": true,
"Categories": true,
"GroupVariantsByProduct": true,
"QuerySuggestions": true,
"IncludeUserToken": true,
"VaryCacheByUserToken": false,
"MinimumQueryLength": 2,
"MaxHitsPerPage": 100,
"QuerySuggestionsProvisioning": {
"Enabled": true,
"UseReplicas": false,
"MinimumHits": 5,
"MinimumLetters": 4,
"EnablePersonalization": false,
"AllowSpecialCharacters": false,
"Exclude": []
},
"Cache": {
"Enabled": true,
"DurationMinutes": 60,
"CacheEmptyResults": true
}
},
"Events": {
"Enabled": true,
"ViewedProduct": true,
"AddedToCart": true,
"StartedCheckout": true,
"Purchase": true
},
"Stores": [
{
"Alias": "Store"
}
]
}
}
}
Settings reference
| Setting | Type | Default | Description |
|---|---|---|---|
Enabled |
bool |
true |
Enables the Algolia plugin. |
ApplicationId |
string |
required | Algolia application ID. |
AdminApiKey |
string |
required | API key used for indexing, settings, replicas, and query suggestion provisioning. |
SearchApiKey |
string |
required | API key used by IAlgoliaSearchService search requests. |
InsightsApiKey |
string |
null |
Optional key for Insights events. Falls back to AdminApiKey when omitted. |
AnalyticsRegion |
string |
null |
Algolia analytics region for query suggestions, usually us or eu. If omitted, the plugin tries both. |
Environment |
string |
prod |
Environment segment used in generated index names. |
Indexing:Enabled |
bool |
true |
Enables indexing features. |
Indexing:Products |
bool |
true |
Enables product indexing. |
Indexing:Categories |
bool |
true |
Enables category indexing. |
Indexing:Variants |
bool |
false |
Indexes product variants as separate product records so variant SKUs can be searched directly. |
Indexing:BatchSize |
int |
1000 |
Batch size for Algolia save/replace/delete operations. |
Indexing:ProductProperties |
string[] |
[] |
Additional product properties/metafields to include in product records. Supports modifiers documented below. |
Indexing:SortedReplicas |
object[] |
[] |
Replica definitions using Attribute and Direction (Asc or Desc). |
Indexing:Dispatching:MaxBatchSize |
int |
100 |
Maximum queued jobs processed in one worker batch. |
Indexing:Dispatching:FlushIntervalSeconds |
int |
2 |
Worker delay between queue flushes. |
Indexing:Dispatching:MaxQueueSize |
int |
10000 |
Maximum in-memory queue size. |
Indexing:Dispatching:MaxConcurrency |
int |
2 |
Maximum indexing worker concurrency. |
ContentIndexing:Enabled |
bool |
false |
Enables standard Umbraco content indexing. |
ContentIndexing:BatchSize |
int |
1000 |
Batch size for content index rebuild operations. |
ContentIndexing:Indexes |
object[] |
[] |
Content indexes to maintain. Index names resolve as {IndexName}.{Environment}.{Culture}. |
ContentIndexing:Indexes[*]:ContentTypes[*]:Alias |
string |
required | Umbraco content type alias to include in the content index. |
ContentIndexing:Indexes[*]:ContentTypes[*]:Properties |
string[] |
[] |
Property aliases to index. Use |unix or |unixms to add numeric date fields. |
Search:Enabled |
bool |
true |
Enables Algolia search services. |
Search:Products |
bool |
true |
Enables product search. |
Search:Categories |
bool |
true |
Enables category search. |
Search:GroupVariantsByProduct |
bool |
true |
When variant indexing is enabled, applies Algolia distinct so product searches group variant records by product. |
Search:QuerySuggestions |
bool |
false |
Enables query suggestion search and provisioning. |
Search:IncludeUserToken |
bool |
true |
Adds userToken to Algolia search requests using IAlgoliaUserTokenProvider, unless the query already has a token. |
Search:VaryCacheByUserToken |
bool |
false |
Includes userToken in search cache keys. Keep false for shared cache; set true when Algolia personalization changes result order/content per user. |
Search:MinimumQueryLength |
int |
2 |
Minimum query length before search executes. Set 0 to disable this guard. |
Search:MaxHitsPerPage |
int |
100 |
Upper bound for requested HitsPerPage. Set 0 or less to avoid clamping. |
Search:Cache:Enabled |
bool |
true |
Enables in-memory search response caching. |
Search:Cache:DurationMinutes |
int |
60 |
Search cache duration. |
Search:Cache:CacheEmptyResults |
bool |
true |
Whether empty result sets are cached. |
Search:QuerySuggestionsProvisioning:Enabled |
bool |
true |
Creates/updates Algolia query suggestion configuration automatically. |
Search:QuerySuggestionsProvisioning:UseReplicas |
bool |
false |
Includes source index replicas in query suggestion generation. |
Search:QuerySuggestionsProvisioning:MinimumHits |
int |
5 |
Minimum hits required for query suggestions. |
Search:QuerySuggestionsProvisioning:MinimumLetters |
int |
4 |
Minimum letters required for query suggestions. |
Search:QuerySuggestionsProvisioning:EnablePersonalization |
bool |
false |
Enables personalization for query suggestions configuration. |
Search:QuerySuggestionsProvisioning:AllowSpecialCharacters |
bool |
false |
Allows special characters in query suggestions. |
Search:QuerySuggestionsProvisioning:Exclude |
string[] |
[] |
Query suggestion exclusion list. |
Events:Enabled |
bool |
true |
Enables Algolia Insights events. |
Events:ViewedProduct |
bool |
true |
Sends product view events. |
Events:AddedToCart |
bool |
true |
Sends add-to-cart conversion events. |
Events:StartedCheckout |
bool |
true |
Sends checkout conversion events. |
Events:Purchase |
bool |
true |
Sends purchase conversion events. |
Stores |
object[] |
[] |
Store aliases supported by the plugin. Locale/currency are resolved from Ekom store data. |
Stores[*]:Alias |
string |
required | Ekom store alias. |
Stores[*]:IncludeStock |
bool |
false |
Includes product stock in indexed records for this store. |
Usage notes
Indexing triggers and API keys
Product and category indexing is triggered from Umbraco content notifications for ekmProduct and ekmCategory.
Search requests use SearchApiKey. Indexing, settings updates, replicas, delete operations, and query suggestion provisioning use AdminApiKey.
{
"Ekom": {
"Algolia": {
"ApplicationId": "APP_ID",
"AdminApiKey": "ADMIN_API_KEY",
"SearchApiKey": "SEARCH_API_KEY"
}
}
}
When Search:QuerySuggestions is enabled, the plugin provisions the separate query_suggestions... index configuration automatically. Set AnalyticsRegion to us or eu if you know it; if omitted, the plugin tries us and then eu.
{
"Ekom": {
"Algolia": {
"AnalyticsRegion": "eu",
"Search": {
"QuerySuggestions": true
}
}
}
}
Index naming and store context
The plugin resolves Algolia index names from the configured environment, store alias, locale, and currency. Callers should not set SearchForHits.IndexName; the search service sets it before executing the request.
Product index names include currency when a currency is resolved:
primary.prod.Store.products.en-US.USD
Category index names omit currency because category records are scoped by store alias and locale only:
primary.prod.Store.categories.en-US
Standard content index names resolve as {IndexName}.{Environment}.{Culture}:
SearchIndex.prod.en-US
Only the store alias must be configured in appsettings.json. Locale and currency are resolved from the Ekom store and the current request/order context. Background indexing falls back to the store's default culture and currency.
{
"Ekom": {
"Algolia": {
"Stores": [
{
"Alias": "Store"
}
]
}
}
}
Searching
IAlgoliaSearchService.SearchProductsAsync(...) returns typed product hits with paging metadata, query text, processing time, and raw facets.
var response = await algoliaSearchService.SearchProductsAsync(
new AlgoliaSearchRequest
{
StoreAlias = "Store",
Locale = "en-US",
Currency = "USD",
Query = new SearchForHits
{
Query = "shoe",
HitsPerPage = 20,
Filters = "Available:1"
}
},
ct).ConfigureAwait(false);
Other search methods target their own index types:
SearchCategoriesAsync(...)searches category records scoped by store alias and locale.SearchContentAsync(...)searches configured standard content indexes.FederatedSearchAsync(...)executes products, categories, query suggestions, and content searches in one Algolia multi-search request.
Search caching and user tokens
Search cache keys include the resolved index name and serialized Algolia query payload, so SDK options such as filters, facets, page, and hits-per-page affect caching.
Search:IncludeUserToken sends user context to Algolia. The default provider uses authenticated username first, then session ID, then request trace identifier.
Search:VaryCacheByUserToken controls whether that token also affects cache keys. Leave it false for shared cache when results are not personalized. Set it to true when Algolia personalization changes result order or content per user.
{
"Ekom": {
"Algolia": {
"Search": {
"IncludeUserToken": true,
"VaryCacheByUserToken": false,
"Cache": {
"Enabled": true,
"DurationMinutes": 60
}
}
}
}
}
Product records and ranking fields
Product records always include Title as a top-level field. NodeName contains the Umbraco node name.
Available is indexed as a numeric value so it can be used for ranking:
{
"Title": "Running shoe",
"NodeName": "Running shoe - black",
"Available": 1
}
Product records also include ProductRanking and CategoryRanking integer fields. Both support negative values.
ProductRankingreads the productekmAlgoliaRankproperty and defaults to0when missing or invalid.CategoryRankinguses the highest validekmAlgoliaRankvalue across the product's categories and defaults to0when no category has a valid rank.
{
"ProductRanking": 10,
"CategoryRanking": 5
}
Variant indexing
Variants are not indexed by default. Enable variant indexing when products use placeholder parent SKUs and the real sellable SKUs live on variants.
{
"Ekom": {
"Algolia": {
"Indexing": {
"Variants": true
},
"Search": {
"GroupVariantsByProduct": true
}
}
}
}
When enabled, the plugin creates one additional product record per variant. Variant records use the variant SKU as top-level Sku, preserve the parent product SKU as ParentSku, and include ProductId and VariantId for grouping and selection.
{
"objectID": "product-key_variant-key",
"ProductId": "product-key",
"VariantId": "variant-key",
"Sku": "REAL-VARIANT-SKU",
"ParentSku": "PLACEHOLDER-SKU",
"IsVariant": true,
"variantSku": "REAL-VARIANT-SKU",
"variantTitle": "Black / XL"
}
Product indexes are configured with AttributeForDistinct = ProductId. Search:GroupVariantsByProduct defaults to true, so normal searches return grouped product results while SKU searches can still match variant records. Set it to false if you want one hit per matching variant.
{
"Ekom": {
"Algolia": {
"Search": {
"GroupVariantsByProduct": false
}
}
}
}
Additional product properties and metafields
Indexing:ProductProperties adds extra product properties and metafields to product records. Each entry supports one optional modifier: |array, |int, |decimal, |unix, or |unixms.
{
"Ekom": {
"Algolia": {
"Indexing": {
"ProductProperties": [
"channels|array",
"stockCount|int",
"weight|decimal",
"publishedAt|unix"
]
}
}
}
}
Metafields can be indexed explicitly with metafield:<alias>:
{
"Ekom": {
"Algolia": {
"Indexing": {
"ProductProperties": [
"metafield:material",
"metafield:color|array",
"metafield:releaseDate|unix"
]
}
}
}
}
Modifier behavior:
|arrayparses JSON arrays such as["Web","Store"]into Algolia string arrays.|decimalaccepts comma or dot decimal separators, such as0,1and0.0.- Multi-value metafields are skipped unless
|arrayis configured. - Invalid
|array,|int, and|decimalvalues are skipped instead of being indexed as strings.
Manual reindexing
Use the backoffice endpoints to rebuild Algolia indexes manually. Both endpoints support GET and POST.
Rebuild all configured store indexes:
POST /umbraco/backoffice/api/Ekom/AlgoliaBackoffice/RebuildIndexes
Rebuild one store:
POST /umbraco/backoffice/api/Ekom/AlgoliaBackoffice/RebuildStoreIndexes?storeAlias=Store
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Algolia.Search (>= 7.40.0)
- Ekom.U17 (>= 0.2.194)
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.Hosting (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.2)
- Umbraco.Cms.Api.Management (>= 17.0.0 && < 18.0.0)
-
net8.0
- Algolia.Search (>= 7.40.0)
- Ekom.U10 (>= 0.2.194)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options (>= 10.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.2.35 | 99 | 7/8/2026 |
| 0.2.34 | 101 | 7/8/2026 |
| 0.2.33 | 102 | 7/7/2026 |
| 0.2.31 | 95 | 7/7/2026 |
| 0.2.30 | 112 | 6/29/2026 |
| 0.2.29 | 97 | 6/28/2026 |
| 0.2.28 | 110 | 6/8/2026 |
| 0.2.27 | 108 | 6/8/2026 |
| 0.2.26 | 263 | 6/7/2026 |
| 0.2.25 | 111 | 6/3/2026 |
| 0.2.24 | 115 | 5/4/2026 |
| 0.2.23 | 117 | 5/4/2026 |
| 0.2.22 | 114 | 4/30/2026 |
| 0.2.21 | 118 | 4/23/2026 |
| 0.2.20 | 121 | 4/23/2026 |
| 0.2.19 | 115 | 4/23/2026 |
| 0.2.18 | 110 | 4/22/2026 |
| 0.2.17 | 109 | 4/22/2026 |
| 0.2.16 | 116 | 4/22/2026 |
| 0.2.15 | 118 | 4/21/2026 |