generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Kentico/feat/indexing-delay
feat(indexing-delay): added support for optional customizable delay
- Loading branch information
Showing
49 changed files
with
2,102 additions
and
2,073 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 55 additions & 55 deletions
110
src/Kentico.Xperience.AzureSearch/Admin/AzureSearchAdminModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
using CMS; | ||
using CMS.Base; | ||
using CMS.Core; | ||
|
||
using Kentico.Xperience.Admin.Base; | ||
using Kentico.Xperience.AzureSearch.Admin; | ||
using Kentico.Xperience.AzureSearch.Aliasing; | ||
using Kentico.Xperience.AzureSearch.Indexing; | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Options; | ||
|
||
[assembly: RegisterModule(typeof(AzureSearchAdminModule))] | ||
|
||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
/// <summary> | ||
/// Manages administration features and integration. | ||
/// </summary> | ||
internal class AzureSearchAdminModule : AdminModule | ||
{ | ||
private IAzureSearchConfigurationStorageService storageService = null!; | ||
private AzureSearchModuleInstaller installer = null!; | ||
|
||
public AzureSearchAdminModule() : base(nameof(AzureSearchAdminModule)) { } | ||
|
||
protected override void OnInit(ModuleInitParameters parameters) | ||
{ | ||
base.OnInit(parameters); | ||
|
||
var options = Service.Resolve<IOptions<AzureSearchOptions>>(); | ||
|
||
if (!options.Value?.SearchServiceEnabled ?? false) | ||
{ | ||
return; | ||
} | ||
|
||
RegisterClientModule("kentico", "xperience-integrations-azuresearch"); | ||
|
||
var services = parameters.Services; | ||
|
||
installer = services.GetRequiredService<AzureSearchModuleInstaller>(); | ||
storageService = services.GetRequiredService<IAzureSearchConfigurationStorageService>(); | ||
|
||
ApplicationEvents.Initialized.Execute += InitializeModule; | ||
} | ||
|
||
private void InitializeModule(object? sender, EventArgs e) | ||
{ | ||
installer.Install(); | ||
|
||
AzureSearchIndexStore.SetIndicies(storageService); | ||
AzureSearchIndexAliasStore.SetAliases(storageService); | ||
} | ||
} | ||
using CMS; | ||
using CMS.Base; | ||
using CMS.Core; | ||
|
||
using Kentico.Xperience.Admin.Base; | ||
using Kentico.Xperience.AzureSearch.Admin; | ||
using Kentico.Xperience.AzureSearch.Aliasing; | ||
using Kentico.Xperience.AzureSearch.Indexing; | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Options; | ||
|
||
[assembly: RegisterModule(typeof(AzureSearchAdminModule))] | ||
|
||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
/// <summary> | ||
/// Manages administration features and integration. | ||
/// </summary> | ||
internal class AzureSearchAdminModule : AdminModule | ||
{ | ||
private IAzureSearchConfigurationStorageService storageService = null!; | ||
private AzureSearchModuleInstaller installer = null!; | ||
|
||
public AzureSearchAdminModule() : base(nameof(AzureSearchAdminModule)) { } | ||
|
||
protected override void OnInit(ModuleInitParameters parameters) | ||
{ | ||
base.OnInit(parameters); | ||
|
||
var options = Service.Resolve<IOptions<AzureSearchOptions>>(); | ||
|
||
if (!options.Value?.SearchServiceEnabled ?? false) | ||
{ | ||
return; | ||
} | ||
|
||
RegisterClientModule("kentico", "xperience-integrations-azuresearch"); | ||
|
||
var services = parameters.Services; | ||
|
||
installer = services.GetRequiredService<AzureSearchModuleInstaller>(); | ||
storageService = services.GetRequiredService<IAzureSearchConfigurationStorageService>(); | ||
|
||
ApplicationEvents.Initialized.Execute += InitializeModule; | ||
} | ||
|
||
private void InitializeModule(object? sender, EventArgs e) | ||
{ | ||
installer.Install(); | ||
|
||
AzureSearchIndexStore.SetIndicies(storageService); | ||
AzureSearchIndexAliasStore.SetAliases(storageService); | ||
} | ||
} |
74 changes: 37 additions & 37 deletions
74
src/Kentico.Xperience.AzureSearch/Admin/AzureSearchIndexIncludedPath.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
public class AzureSearchIndexIncludedPath | ||
{ | ||
/// <summary> | ||
/// The node alias pattern that will be used to match pages in the content tree for indexing. | ||
/// </summary> | ||
/// <remarks>For example, "/Blogs/Products/" will index all pages under the "Products" page.</remarks> | ||
public string AliasPath { get; } | ||
|
||
/// <summary> | ||
/// A list of content types under the specified <see cref="AliasPath"/> that will be indexed. | ||
/// </summary> | ||
public List<AzureSearchIndexContentType> ContentTypes { get; set; } = []; | ||
|
||
/// <summary> | ||
/// The internal identifier of the included path. | ||
/// </summary> | ||
public string? Identifier { get; set; } | ||
|
||
[JsonConstructor] | ||
public AzureSearchIndexIncludedPath(string aliasPath) => AliasPath = aliasPath; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="indexPath"></param> | ||
/// <param name="contentTypes"></param> | ||
public AzureSearchIndexIncludedPath(AzureSearchIncludedPathItemInfo indexPath, IEnumerable<AzureSearchIndexContentType> contentTypes) | ||
{ | ||
AliasPath = indexPath.AzureSearchIncludedPathItemAliasPath; | ||
ContentTypes = contentTypes.ToList(); | ||
Identifier = indexPath.AzureSearchIncludedPathItemId.ToString(); | ||
} | ||
} | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
public class AzureSearchIndexIncludedPath | ||
{ | ||
/// <summary> | ||
/// The node alias pattern that will be used to match pages in the content tree for indexing. | ||
/// </summary> | ||
/// <remarks>For example, "/Blogs/Products/" will index all pages under the "Products" page.</remarks> | ||
public string AliasPath { get; } | ||
|
||
/// <summary> | ||
/// A list of content types under the specified <see cref="AliasPath"/> that will be indexed. | ||
/// </summary> | ||
public List<AzureSearchIndexContentType> ContentTypes { get; set; } = []; | ||
|
||
/// <summary> | ||
/// The internal identifier of the included path. | ||
/// </summary> | ||
public string? Identifier { get; set; } | ||
|
||
[JsonConstructor] | ||
public AzureSearchIndexIncludedPath(string aliasPath) => AliasPath = aliasPath; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="indexPath"></param> | ||
/// <param name="contentTypes"></param> | ||
public AzureSearchIndexIncludedPath(AzureSearchIncludedPathItemInfo indexPath, IEnumerable<AzureSearchIndexContentType> contentTypes) | ||
{ | ||
AliasPath = indexPath.AzureSearchIncludedPathItemAliasPath; | ||
ContentTypes = contentTypes.ToList(); | ||
Identifier = indexPath.AzureSearchIncludedPathItemId.ToString(); | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
src/Kentico.Xperience.AzureSearch/Admin/AzureSearchIndexPermissions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
internal static class AzureSearchIndexPermissions | ||
{ | ||
public const string REBUILD = "Rebuild"; | ||
} | ||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
internal static class AzureSearchIndexPermissions | ||
{ | ||
public const string REBUILD = "Rebuild"; | ||
} |
28 changes: 14 additions & 14 deletions
28
src/Kentico.Xperience.AzureSearch/Admin/AzureSearchIndexStatisticsViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
public class AzureSearchIndexStatisticsViewModel | ||
{ | ||
// | ||
// Summary: | ||
// Index name. | ||
public string? Name { get; set; } | ||
|
||
// | ||
// Summary: | ||
// Number of records contained in the index | ||
public long Entries { get; set; } | ||
} | ||
namespace Kentico.Xperience.AzureSearch.Admin; | ||
|
||
public class AzureSearchIndexStatisticsViewModel | ||
{ | ||
// | ||
// Summary: | ||
// Index name. | ||
public string? Name { get; set; } | ||
|
||
// | ||
// Summary: | ||
// Number of records contained in the index | ||
public long Entries { get; set; } | ||
} |
Oops, something went wrong.