using System.Xml.XPath; using Examine.Search; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Xml; 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); [Obsolete("The current implementation of this method is suboptimal and will be removed entirely in a future version. Scheduled for removal in v14")] IPublishedContent? ContentSingleAtXPath(string xpath, params XPathVariable[] vars); IEnumerable Content(IEnumerable ids); IEnumerable Content(IEnumerable ids); IEnumerable Content(IEnumerable ids); [Obsolete("The current implementation of this method is suboptimal and will be removed entirely in a future version. Scheduled for removal in v14")] IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars); [Obsolete("The current implementation of this method is suboptimal and will be removed entirely in a future version. Scheduled for removal in v14")] IEnumerable ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars); 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); }