Skip to content

Commit

Permalink
Merge pull request #3 from Kentico/fix/rebuild-index-delete-data
Browse files Browse the repository at this point in the history
Rebuild fix
  • Loading branch information
bkapustik authored Feb 23, 2024
2 parents 834a951 + fae0325 commit ad07119
Show file tree
Hide file tree
Showing 16 changed files with 109 additions and 136 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
Expand Down
Binary file modified database/DancingGoat_AzureAISearch.bak
Binary file not shown.
112 changes: 50 additions & 62 deletions examples/DancingGoat/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"dependencies": {
"net6.0": {
"net8.0": {
"Kentico.Xperience.Admin": {
"type": "Direct",
"requested": "[28.2.1, )",
Expand Down Expand Up @@ -155,8 +155,8 @@
"resolved": "13.8.1",
"contentHash": "KgsJ88vcX0UfSKAO7uzbEPOGu8wwJU3Vkgz7AgeTrnfdgIVjZFkesvMxDqjzY6F3fmMbJmfAOLjufYLFs1Fq1g==",
"dependencies": {
"Microsoft.Extensions.ObjectPool": "6.0.0",
"System.Diagnostics.DiagnosticSource": "6.0.0",
"Microsoft.Extensions.ObjectPool": "8.0.0",
"System.Diagnostics.DiagnosticSource": "8.0.0",
"System.Threading.Tasks.Extensions": "4.5.0"
}
},
Expand All @@ -181,8 +181,7 @@
"contentHash": "+llX8ziARzp+aKsOaXQfZAtqE+lF8gSmTiMiRCdpf03M+IWl/uCD9965nhqkM4mauWufwBXlwA7TE4uIUu+UjQ==",
"dependencies": {
"HotChocolate.Language": "13.8.1",
"Microsoft.Bcl.AsyncInterfaces": "6.0.0",
"System.Collections.Immutable": "6.0.0"
"System.Collections.Immutable": "8.0.0"
}
},
"HotChocolate.AspNetCore": {
Expand Down Expand Up @@ -226,8 +225,8 @@
"HotChocolate.Types": "13.8.1",
"HotChocolate.Utilities.DependencyInjection": "13.8.1",
"HotChocolate.Validation": "13.8.1",
"Microsoft.Extensions.DependencyInjection": "6.0.0",
"System.Threading.Channels": "6.0.0"
"Microsoft.Extensions.DependencyInjection": "8.0.0",
"System.Threading.Channels": "8.0.0"
}
},
"HotChocolate.Execution.Abstractions": {
Expand All @@ -236,7 +235,7 @@
"contentHash": "sAL6A/Qa23inTgu8sWiNoaKpaJ3MosXLsiP908+XUogMOjudpWnaSWPYu5THgl1deaQ6q55gbyiFvwJx5lRR8A==",
"dependencies": {
"HotChocolate.Abstractions": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
}
},
"HotChocolate.Fetching": {
Expand Down Expand Up @@ -264,7 +263,7 @@
"resolved": "13.8.1",
"contentHash": "0RYVxhsxR1vf0ue/V8GZnN8UVxh1bI74KPe0vFLLlNXRSq55LXTuGt3gYc6+LxSCc4KaItzRl6DwdgRuDRINjw==",
"dependencies": {
"Microsoft.Extensions.ObjectPool": "6.0.0"
"Microsoft.Extensions.ObjectPool": "8.0.0"
}
},
"HotChocolate.Language.Utf8": {
Expand Down Expand Up @@ -307,15 +306,15 @@
"dependencies": {
"HotChocolate.Execution.Abstractions": "13.8.1",
"HotChocolate.Subscriptions": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
}
},
"HotChocolate.Transport.Sockets": {
"type": "Transitive",
"resolved": "13.8.1",
"contentHash": "YVfn1O+B0UlGKtieqRoGEeZjnFpSNjK1ZQVLvfKZ/DfCh+7FR9CwZ6II7YXWCE+M9sCQTvEo9Cz5XCpsnJDhIw==",
"dependencies": {
"System.IO.Pipelines": "6.0.0"
"System.IO.Pipelines": "8.0.0"
}
},
"HotChocolate.Types": {
Expand All @@ -326,10 +325,10 @@
"HotChocolate.Abstractions": "13.8.1",
"HotChocolate.Types.Shared": "13.8.1",
"HotChocolate.Utilities": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.ObjectPool": "6.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.ObjectPool": "8.0.0",
"System.ComponentModel.Annotations": "5.0.0",
"System.Text.Json": "6.0.7"
"System.Text.Json": "8.0.0"
}
},
"HotChocolate.Types.CursorPagination": {
Expand Down Expand Up @@ -385,7 +384,7 @@
"resolved": "13.8.1",
"contentHash": "4tEg4xfDfiahuLrC59gH+BYfAFqDPEvoyBK7PU3ep7O2cmQgnqeE3tKMqJ1UovGMsVQ5nYwcQ98LhqrPOxECUw==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "6.0.0"
"Microsoft.Extensions.DependencyInjection": "8.0.0"
}
},
"HotChocolate.Validation": {
Expand All @@ -394,8 +393,8 @@
"contentHash": "kmPmYrtCt1NtmyZiSvfjDU+Abc/4hI2wDLe1uDEZW8JC8O2uwH0becZm1K6j9ZUfVMLp/5ZNsQONOXzL1VwxLA==",
"dependencies": {
"HotChocolate.Types": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Options": "6.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Options": "8.0.0"
}
},
"HtmlSanitizer": {
Expand Down Expand Up @@ -460,8 +459,8 @@
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
"resolved": "1.1.1",
"contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w=="
},
"Microsoft.CSharp": {
"type": "Transitive",
Expand Down Expand Up @@ -540,17 +539,16 @@
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "6.0.1",
"contentHash": "vWXPg3HJQIpZkENn1KWq8SfbqVujVD7S7vIAyFXXqK5xkf1Vho+vG0bLBCHxU36lD1cLLtmGpfYf0B3MYFi9tQ==",
"resolved": "8.0.0",
"contentHash": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg=="
"resolved": "8.0.0",
"contentHash": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg=="
},
"Microsoft.Extensions.FileProviders.Abstractions": {
"type": "Transitive",
Expand Down Expand Up @@ -639,16 +637,16 @@
},
"Microsoft.Extensions.ObjectPool": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "7hR9FU0JJHOCLmn/Ary31pLLAhlzoMptBKs5CJmNUzD87dXjl+/NqVkyCTl6cT2JAfTK0G39HpvCOv1fhsX3BQ=="
"resolved": "8.0.0",
"contentHash": "4pm+XgxSukskwjzDDfSjG4KNUIOdFF2VaqZZDtTzoyQMOVSnlV6ZM8a9aVu5dg9LVZTB//utzSc8fOi0b0Mb2Q=="
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==",
"resolved": "8.0.0",
"contentHash": "JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Primitives": "6.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Primitives": "8.0.0"
}
},
"Microsoft.Extensions.Options.ConfigurationExtensions": {
Expand All @@ -665,11 +663,8 @@
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
},
"Microsoft.Identity.Client": {
"type": "Transitive",
Expand Down Expand Up @@ -817,10 +812,7 @@
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg=="
},
"System.ComponentModel.Annotations": {
"type": "Transitive",
Expand All @@ -832,16 +824,19 @@
"resolved": "8.0.0",
"contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==",
"dependencies": {
"System.Diagnostics.EventLog": "8.0.0",
"System.Security.Cryptography.ProtectedData": "8.0.0"
}
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "6.0.1",
"contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "c9xLpVz6PL9lp/djOWtk5KPDZq3cSYpmXoJQY524EOtuFl5z9ZtsotpsyrDW40U1DRnQSYvcPKEUV0X//u6gkQ=="
},
"System.Diagnostics.EventLog": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
},
"System.Formats.Asn1": {
"type": "Transitive",
Expand Down Expand Up @@ -873,8 +868,8 @@
},
"System.IO.Pipelines": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "mXX66shZ4xLlI3vNLaJ0lt8OIZdmXTvIqXRdQX5HLVGSkLhINLsVhyZuX2UdRFnOGkqnwmMUs40pIIQ7mna4+A=="
"resolved": "8.0.0",
"contentHash": "FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA=="
},
"System.Memory": {
"type": "Transitive",
Expand Down Expand Up @@ -965,32 +960,25 @@
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ=="
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "6.0.7",
"contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==",
"resolved": "8.0.0",
"contentHash": "OdrZO2WjkiEG6ajEFRABTRCi/wuXQPxeV6g8xvUJqdxMvvuCCEk86zPla8UiIQJz3durtUEbNyY/3lIhS0yZvQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
"System.Text.Encodings.Web": "8.0.0"
}
},
"System.Threading.Channels": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q=="
"resolved": "8.0.0",
"contentHash": "CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA=="
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
Expand Down
Binary file modified images/xperience-administration-dashboard.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/xperience-administration-search-alias-index-edit-form.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/xperience-administration-search-alias-index-list.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/xperience-administration-search-index-edit-form.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/xperience-administration-search-index-list.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class AzureSearchAliasConfigurationModel
public string AliasName { get; set; } = "";

[GeneralSelectorComponent(dataProviderType: typeof(ExistingIndexOptionsProvider), Label = "Index Names", Order = 2)]
[MinLength(1, ErrorMessage = "You must select at least one index name")]
public IEnumerable<string> IndexNames { get; set; } = Enumerable.Empty<string>();

public AzureSearchAliasConfigurationModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ public class AzureSearchConfigurationModel
public string IndexName { get; set; } = "";

[GeneralSelectorComponent(dataProviderType: typeof(LanguageOptionsProvider), Label = "Indexed Languages", Order = 2)]
[MinLength(1, ErrorMessage = "You must select at least one Language Name")]
public IEnumerable<string> LanguageNames { get; set; } = Enumerable.Empty<string>();

[DropDownComponent(Label = "Channel Name", DataProviderType = typeof(ChannelOptionsProvider), Order = 3)]
[Required]
public string ChannelName { get; set; } = "";

[DropDownComponent(Label = "Indexing Strategy", DataProviderType = typeof(IndexingStrategyOptionsProvider), Order = 4, ExplanationText = "Changing strategy which has an incompatible configuration will result in deleting indexed items.")]
[Required]
public string StrategyName { get; set; } = "";

[TextInputComponent(Label = "Rebuild Hook")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
identifier: AzureSearchApplicationPage.IDENTIFIER,
type: typeof(AzureSearchApplicationPage),
slug: "azuresearch",
name: "Search",
name: "Azure AI Search",
category: BaseApplicationCategories.DEVELOPMENT,
icon: Icons.Magnifier,
templateName: TemplateNames.SECTION_LAYOUT)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
parentType: typeof(IndexListingPage),
slug: "indexes",
uiPageType: typeof(IndexAliasListingPage),
name: "List of registered AzureSearch index aliases",
name: "List of registered Azure AI Search index aliases",
templateName: TemplateNames.LISTING,
order: UIPageOrder.NoOrder)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
parentType: typeof(AzureSearchApplicationPage),
slug: "indexes",
uiPageType: typeof(IndexListingPage),
name: "List of registered AzureSearch indices",
name: "List of registered Azure AI Search indices",
templateName: TemplateNames.LISTING,
order: UIPageOrder.NoOrder)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ internal class DefaultAzureSearchClient : IAzureSearchClient
private readonly IInfoProvider<ChannelInfo> channelProvider;
private readonly IConversionService conversionService;
private readonly IProgressiveCache cache;
private readonly IEventLogService log;
private readonly SearchIndexClient searchIndexClient;

public DefaultAzureSearchClient(
Expand All @@ -33,7 +32,6 @@ public DefaultAzureSearchClient(
IInfoProvider<ChannelInfo> channelProvider,
IConversionService conversionService,
IProgressiveCache cache,
IEventLogService log,
SearchIndexClient searchIndexClient)
{
this.azureSearchIndexClientService = azureSearchIndexClientService;
Expand All @@ -43,7 +41,6 @@ public DefaultAzureSearchClient(
this.channelProvider = channelProvider;
this.conversionService = conversionService;
this.cache = cache;
this.log = log;
this.searchIndexClient = searchIndexClient;
}

Expand Down Expand Up @@ -164,11 +161,7 @@ private async Task RebuildInternal(AzureSearchIndex azureSearchIndex, Cancellati
}
}

log.LogInformation(
"Kentico.Xperience.AzureSearch",
"INDEX_REBUILD",
$"Rebuilding index [{azureSearchIndex.IndexName}]. {indexedItems.Count} web page items queued for re-indexing"
);
await searchIndexClient.DeleteIndexAsync(azureSearchIndex.IndexName, cancellationToken ?? default);

indexedItems.ForEach(item => AzureSearchQueueWorker.EnqueueAzureSearchQueueItem(new AzureSearchQueueItem(item, AzureSearchTaskType.PUBLISH_INDEX, azureSearchIndex.IndexName)));
}
Expand Down
Loading

0 comments on commit ad07119

Please sign in to comment.