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

Creates a new instance of the SearchParameters class for a page search for given searchPattern 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: 13.0.131
Syntax
C#
public static SearchParameters PrepareForPages(
	SearchPattern searchPattern,
	IEnumerable<string> searchIndexNames,
	int pageNumber,
	int pageSize,
	IUserInfo user,
	string cultureName,
	bool combineWithDefaultCulture
)

Parameters

searchPattern
Type: CMS.SearchSearchPattern
Text to search for with specified level of support for syntax.
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 searchPattern containts text which is null or whitespace string.
Remarks
The default culture is determined by GetDefaultCultureCode(String) call for CurrentSiteName
See Also