Click or drag to resize
SearchParametersPrepareForPages Method (String, IEnumerableString, Int32, Int32, IUserInfo, String, Boolean)

Creates a new instance of the SearchParameters class for a page search for given searchText across indexes specified in searchIndexNames. The user parameter limits search result when performing permission checks in result filtering.

Retrieves the result for the first page for invalid page numbers.

Namespace: CMS.Search
Assembly: CMS.Search (in CMS.Search.dll) Version: 12.0.0
Syntax
C#
public static SearchParameters PrepareForPages(
	string searchText,
	IEnumerable<string> searchIndexNames,
	int pageNumber,
	int pageSize,
	IUserInfo user,
	string cultureName,
	bool combineWithDefaultCulture
)

Parameters

searchText
Type: SystemString
Text to search for.
searchIndexNames
Type: System.Collections.GenericIEnumerableString
Names of indexes to perform search on.
pageNumber
Type: SystemInt32
Number of a page for which to retrieve results, starting from 1.
pageSize
Type: SystemInt32
Size of a page.
user
Type: CMS.BaseIUserInfo
User for whom to filter the result.
cultureName
Type: SystemString
Name of culture to search in. Pass null to search in all cultures.
combineWithDefaultCulture
Type: SystemBoolean
Indicates whether the search service uses site default language version of pages as a replacement for pages that are not translated into the language specified by cultureName.

Return Value

Type: SearchParameters
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when searchIndexNames is null.
ArgumentExceptionThrown when searchText is null or whitespace string.
Remarks
The default culture is determined by GetDefaultCultureCode(String) call for CurrentSiteName
See Also