Class ContentIndexPopulator
Performs the data lookups required to rebuild a content index
Namespace: Umbraco.Cms.Infrastructure.Examine
Assembly: Umbraco.Infrastructure.dll
Syntax
public class ContentIndexPopulator : IndexPopulator<IUmbracoContentIndex>, IIndexPopulator
Constructors
View SourceContentIndexPopulator(ILogger<ContentIndexPopulator>, bool, int?, IContentService, IUmbracoDatabaseFactory, IValueSetBuilder<IContent>)
Initializes a new instance of the ContentIndexPopulator class.
Declaration
[Obsolete("Please use the non-obsolete constructor. Scheduled for removal in Umbraco 19.")]
public ContentIndexPopulator(ILogger<ContentIndexPopulator> logger, bool publishedValuesOnly, int? parentId, IContentService contentService, IUmbracoDatabaseFactory umbracoDatabaseFactory, IValueSetBuilder<IContent> contentValueSetBuilder)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<ContentIndexPopulator> | logger | The logger used for diagnostic and operational messages. |
| bool | publishedValuesOnly | If set to |
| int? | parentId | An optional parent content ID to restrict indexing to its descendants, or |
| IContentService | contentService | Service for accessing and managing content items. |
| IUmbracoDatabaseFactory | umbracoDatabaseFactory | Factory for obtaining Umbraco database connections. |
| IValueSetBuilder<IContent> | contentValueSetBuilder | Builds value sets for content items to be indexed. |
ContentIndexPopulator(ILogger<ContentIndexPopulator>, bool, int?, IContentService, IUmbracoDatabaseFactory, IValueSetBuilder<IContent>, IOptionsMonitor<IndexingSettings>)
Initializes a new instance of the ContentIndexPopulator class with custom query parameters.
Declaration
public ContentIndexPopulator(ILogger<ContentIndexPopulator> logger, bool publishedValuesOnly, int? parentId, IContentService contentService, IUmbracoDatabaseFactory umbracoDatabaseFactory, IValueSetBuilder<IContent> contentValueSetBuilder, IOptionsMonitor<IndexingSettings> indexingSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<ContentIndexPopulator> | logger | The logger used for diagnostic and error messages. |
| bool | publishedValuesOnly | If true, only published content values are indexed. |
| int? | parentId | An optional parent content ID to restrict indexing to a subtree. |
| IContentService | contentService | The service used to access content items. |
| IUmbracoDatabaseFactory | umbracoDatabaseFactory | The factory for obtaining Umbraco database connections. |
| IValueSetBuilder<IContent> | contentValueSetBuilder | Builds value sets for content items to be indexed. |
| IOptionsMonitor<IndexingSettings> | indexingSettings | Monitors configuration settings for indexing. |
ContentIndexPopulator(ILogger<ContentIndexPopulator>, IContentService, IUmbracoDatabaseFactory, IContentValueSetBuilder)
Initializes a new instance of the ContentIndexPopulator class, which is responsible for populating the content index in Examine.
Declaration
[Obsolete("Please use the non-obsolete constructor. Scheduled for removal in Umbraco 19.")]
public ContentIndexPopulator(ILogger<ContentIndexPopulator> logger, IContentService contentService, IUmbracoDatabaseFactory umbracoDatabaseFactory, IContentValueSetBuilder contentValueSetBuilder)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<ContentIndexPopulator> | logger | The logger used for logging diagnostic and error information. |
| IContentService | contentService | The service used to access and manage Umbraco content items. |
| IUmbracoDatabaseFactory | umbracoDatabaseFactory | The factory for creating Umbraco database connections. |
| IContentValueSetBuilder | contentValueSetBuilder | The builder used to create value sets for content indexing. |
ContentIndexPopulator(ILogger<ContentIndexPopulator>, IContentService, IUmbracoDatabaseFactory, IContentValueSetBuilder, IOptionsMonitor<IndexingSettings>)
Initializes a new instance of the ContentIndexPopulator class, used to populate the content index with all content data.
Declaration
public ContentIndexPopulator(ILogger<ContentIndexPopulator> logger, IContentService contentService, IUmbracoDatabaseFactory umbracoDatabaseFactory, IContentValueSetBuilder contentValueSetBuilder, IOptionsMonitor<IndexingSettings> indexingSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<ContentIndexPopulator> | logger | The logger instance used for diagnostic and error logging. |
| IContentService | contentService | The service used to access and manage content items. |
| IUmbracoDatabaseFactory | umbracoDatabaseFactory | The factory for creating Umbraco database connections. |
| IContentValueSetBuilder | contentValueSetBuilder | Builds value sets for content items to be indexed. |
| IOptionsMonitor<IndexingSettings> | indexingSettings | The monitor providing indexing configuration settings. |
Methods
View SourceIndexAllContent(int, int, int, IReadOnlyList<IIndex>)
Declaration
protected void IndexAllContent(int contentParentId, int pageIndex, int pageSize, IReadOnlyList<IIndex> indexes)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contentParentId | |
| int | pageIndex | |
| int | pageSize | |
| IReadOnlyList<IIndex> | indexes |
IndexPublishedContent(int, int, int, IReadOnlyList<IIndex>)
Declaration
protected void IndexPublishedContent(int contentParentId, int pageIndex, int pageSize, IReadOnlyList<IIndex> indexes)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contentParentId | |
| int | pageIndex | |
| int | pageSize | |
| IReadOnlyList<IIndex> | indexes |
IsRegistered(IUmbracoContentIndex)
Determines whether the specified content index is registered for population.
Declaration
public override bool IsRegistered(IUmbracoContentIndex index)
Parameters
| Type | Name | Description |
|---|---|---|
| IUmbracoContentIndex | index | The content index to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
PopulateIndexes(IReadOnlyList<IIndex>)
Declaration
protected override void PopulateIndexes(IReadOnlyList<IIndex> indexes)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<IIndex> | indexes |