Interface IContentSearchService<TContent>
Provides search services for content items of a specific type.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IContentSearchService<TContent> where TContent : class, IContentBase
Type Parameters
| Name | Description |
|---|---|
| TContent | The type of content to search for. |
Methods
View SourceSearchChildrenAsync(string?, Guid?, string[]?, Ordering?, bool, int, int)
Searches for children of a content item with optional property filtering.
Declaration
Task<PagedModel<TContent>> SearchChildrenAsync(string? query, Guid? parentId, string[]? propertyAliases, Ordering? ordering, bool loadTemplates = true, int skip = 0, int take = 100)
Parameters
| Type | Name | Description |
|---|---|---|
| string | query | The search query. |
| Guid? | parentId | The parent content item key. |
| string[] | propertyAliases | The property aliases to load. If null, all properties are loaded. If empty array, no custom properties are loaded. |
| Ordering | ordering | The ordering. |
| bool | loadTemplates | Whether to load templates. Set to false for performance optimization when templates are not needed (e.g., collection views). Default is true. Only applies to Document content; ignored for Media/Member. |
| int | skip | The number of items to skip. |
| int | take | The number of items to take. |
Returns
| Type | Description |
|---|---|
| Task<PagedModel<TContent>> | A paged model of content items. |
SearchChildrenAsync(string?, Guid?, Ordering?, int, int)
Searches for child content items under a specified parent.
Declaration
[Obsolete("Please use the method overload with all parameters. Scheduled for removal in Umbraco 19.")]
Task<PagedModel<TContent>> SearchChildrenAsync(string? query, Guid? parentId, Ordering? ordering, int skip = 0, int take = 100)
Parameters
| Type | Name | Description |
|---|---|---|
| string | query | The search query. |
| Guid? | parentId | The parent content item key. |
| Ordering | ordering | The ordering. |
| int | skip | The number of items to skip. |
| int | take | The number of items to take. |
Returns
| Type | Description |
|---|---|
| Task<PagedModel<TContent>> | A paged model of content items. |