SaaS CMS has officially launched! Learn more now.

Class SearchDataSource

Provides PageData data to DataBoundControl implementations through search based on various criteria.

Inheritance
System.Object
SearchDataSource
Implements
System.ComponentModel.IListSource
System.Web.UI.IHierarchicalDataSource
System.Web.UI.IDataSource
Inherited Members
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.Web.WebControls.dll
Version: 10.10.4
Syntax
public class SearchDataSource : PageDataSource, IListSource, IHierarchicalDataSource, IDataSource, IDataSourceMethods
Examples

Refer to "Using Data Source Controls" under "Navigations and Listings" in the Developer Guide for more information and examples.

Constructors

SearchDataSource()

Initializes a new instance of the SearchDataSource class.

Declaration
public SearchDataSource()

SearchDataSource(SearchIndexConfig)

Initializes a new instance of the SearchDataSource class.

Declaration
public SearchDataSource(SearchIndexConfig searchIndexConfig)
Parameters
Type Name Description
SearchIndexConfig searchIndexConfig

The search index config.

Properties

Criteria

The search criterias that limit the search

Declaration
public List<PropertyCriteriaControl> Criteria { get; }
Property Value
Type Description
System.Collections.Generic.List<PropertyCriteriaControl>
Remarks

The PropertyCriteria in the Criterias collection may be used in two different ways

LanguageBranches

Gets or sets a comma separated list of the language branches to be searched in.

Declaration
public string LanguageBranches { get; set; }
Property Value
Type Description
System.String

The language branches.

MaxAllowHits

By default no more than 100 hits can be returned for performance reasons

Declaration
public int MaxAllowHits { get; set; }
Property Value
Type Description
System.Int32

PageCriteriaSearchService

Gets or sets the IPageCriteriaQueryService that is used internally in this instance.

Declaration
public Injected<IPageCriteriaQueryService> PageCriteriaSearchService { get; set; }
Property Value
Type Description
Injected<IPageCriteriaQueryService>

SearchQuery

Search query string.

Declaration
public string SearchQuery { get; set; }
Property Value
Type Description
System.String
Remarks

If SearchQuery is empty and the Criterias collection contains at least one PropertyCriteria, the search will be performed using FindPagesWithCriteria(PageReference, PropertyCriteriaCollection). Default you will only get hits on pages where PageVisibleInMenu is true. If you want to get hits on pages where PageVisibleInMenu is false you need to set the property EnableVisibleInMenu to false.

Methods

AddTrailingWildcards(String)

Declaration
public virtual string AddTrailingWildcards(string query)
Parameters
Type Name Description
System.String query
Returns
Type Description
System.String

Delete(IDictionary)

Declaration
public override int Delete(IDictionary values)
Parameters
Type Name Description
System.Collections.IDictionary values
Returns
Type Description
System.Int32
Overrides

RaiseChanged()

Declaration
public void RaiseChanged()

Select(DataSourceSelectArguments)

Declaration
public override IEnumerable Select(DataSourceSelectArguments arguments)
Parameters
Type Name Description
System.Web.UI.DataSourceSelectArguments arguments
Returns
Type Description
System.Collections.IEnumerable
Overrides

Implements

System.ComponentModel.IListSource
System.Web.UI.IHierarchicalDataSource
System.Web.UI.IDataSource

Extension Methods