Class SearchDataSource
Provides PageData data to DataBoundControl implementations through search based on various criteria.
Implements
Inherited Members
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.Web.WebControls.dll
Version: 9.12.2Syntax
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. |
MainCatalog
The index server catalog to search in.
Declaration
[Obsolete("This Accessor is no longer being used, indexing is now handled through the Indexing Service")]
public string MainCatalog { get; set; }
Property Value
Type | Description |
---|---|
System.String |
MainScope
The scope parameter for index server searches. The default is deep traversal under the catalog root.
Declaration
[Obsolete("This Accessor is no longer being used, indexing is now handled through the Indexing Service")]
public string MainScope { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
OnlyWholeWords
A flag to control if the search will match only whole words. If False, the search will match all words that begin with the words in the query (word* match).
Declaration
[Obsolete("This Accessor is no longer being used, handled by the Indexing Service")]
public bool OnlyWholeWords { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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> |
SearchFiles
A flag to tell whether files should be included in the search or not.
Declaration
[Obsolete("SearchDataSource does not support searching for files", false)]
public bool SearchFiles { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SearchLocations
A comma separated string of file system locations used as starting locations when searching for files.
Declaration
[Obsolete("SearchDataSource does not support searching for files", false)]
public string SearchLocations { get; set; }
Property Value
Type | Description |
---|---|
System.String | Default value in String.Empty |
Remarks
If empty, will search in all unified directories.
You can set more than one location by building a comma-separated list of paths.
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 |