using System;
using System.Collections.Generic;
using System.Xml.XPath;
using Examine.Search;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Xml;
namespace Umbraco.Web
{
// TODO: Merge this into IPublishedContentQuery for v9!
public interface IPublishedContentQuery2 : IPublishedContentQuery
{
///
/// 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 ).
/// The fields to load in the results of the search (defaults to all fields loaded).
///
/// 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);
}
///
/// 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 ContentSingleAtXPath(string xpath, params XPathVariable[] vars);
IEnumerable Content(IEnumerable ids);
IEnumerable Content(IEnumerable ids);
IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars);
IEnumerable ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars);
IEnumerable ContentAtRoot();
IPublishedContent Media(int id);
IPublishedContent Media(Guid id);
IPublishedContent Media(Udi id);
IEnumerable Media(IEnumerable ids);
IEnumerable Media(IEnumerable ids);
IEnumerable MediaAtRoot();
///
/// 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);
///
/// 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 ).
///
/// 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);
///
/// 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);
}
}