using Examine.Search; using Umbraco.Cms.Core.Models.PublishedContent; namespace Umbraco.Cms.Core; /// /// Query methods used for accessing strongly typed content in templates. /// public interface IPublishedContentQuery { IPublishedContent? Content(int id); IPublishedContent? Content(Guid id); IPublishedContent? Content(Udi id); IPublishedContent? Content(object id); IEnumerable Content(IEnumerable ids); IEnumerable Content(IEnumerable ids); IEnumerable Content(IEnumerable ids); IEnumerable ContentAtRoot(); IPublishedContent? Media(int id); IPublishedContent? Media(Guid id); IPublishedContent? Media(Udi id); IPublishedContent? Media(object id); IEnumerable Media(IEnumerable ids); IEnumerable Media(IEnumerable ids); IEnumerable Media(IEnumerable ids); IEnumerable MediaAtRoot(); /// /// Searches content. /// /// The term to search. /// The amount of results to skip. /// The amount of results to take/return. /// The total amount of records. /// The culture (defaults to a culture insensitive search). /// /// The name of the index to search (defaults to /// ). /// /// /// This parameter is no longer used, because the results are loaded from the published snapshot /// using the single item ID field. /// /// /// The search results. /// /// /// /// When the is not specified or is *, all cultures are searched. /// To search for only invariant documents and fields use null. /// When searching on a specific culture, all culture specific fields are searched for the provided culture and all /// invariant fields for all documents. /// /// While enumerating results, the ambient culture is changed to be the searched culture. /// IEnumerable Search( string term, int skip, int take, out long totalRecords, string culture = "*", string indexName = Constants.UmbracoIndexes.ExternalIndexName, ISet? loadedFields = null); /// /// Searches content. /// /// The term to search. /// The culture (defaults to a culture insensitive search). /// /// The name of the index to search (defaults to /// ). /// /// /// The search results. /// /// /// /// When the is not specified or is *, all cultures are searched. /// To search for only invariant documents and fields use null. /// When searching on a specific culture, all culture specific fields are searched for the provided culture and all /// invariant fields for all documents. /// /// While enumerating results, the ambient culture is changed to be the searched culture. /// IEnumerable Search(string term, string culture = "*", string indexName = Constants.UmbracoIndexes.ExternalIndexName); /// /// Executes the query and converts the results to . /// /// The query. /// /// The search results. /// IEnumerable Search(IQueryExecutor query); /// /// Executes the query and converts the results to . /// /// The query. /// The amount of results to skip. /// The amount of results to take/return. /// The total amount of records. /// /// The search results. /// IEnumerable Search(IQueryExecutor query, int skip, int take, out long totalRecords); /// /// Executes the query and converts the results to . /// /// The query. /// The amount of results to skip. /// The amount of results to take/return. /// The total amount of records. /// The culture (defaults to a culture insensitive search). /// /// The search results. /// /// /// While enumerating results, the ambient culture is changed to be the searched culture. /// IEnumerable Search(IQueryExecutor query, int skip, int take, out long totalRecords, string? culture) => Search(query, skip, take, out totalRecords); }