SearchParametersPrepareForPages Method (SearchPattern, IEnumerableString, Int32, Int32, IUserInfo, 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.SearchAssembly: CMS.Search (in CMS.Search.dll) Version: 13.0.131
Syntax public static SearchParameters PrepareForPages(
SearchPattern searchPattern,
IEnumerable<string> searchIndexNames,
int pageNumber,
int pageSize,
IUserInfo user,
bool combineWithDefaultCulture = false
)
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. - combineWithDefaultCulture (Optional)
- 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 the search performed in (see the Remarks section on details of the search culture).
Return Value
Type:
SearchParametersExceptions Exception | Condition |
---|
ArgumentNullException | Thrown when searchIndexNames is null. |
ArgumentException | Thrown when searchPattern containts text which is null or whitespace string. |
Remarks
This method passes Name value of CurrentUICulture as the name of culture
to search in.
See Also