Poq.SDK.Node

Home > @poq/sdk-sfcc > ContentSearchClient > getContentSearch

ContentSearchClient.getContentSearch() method

Provides keyword and refinement search functionality for content assets. The search result contains only content that is online and assigned to a folder.

Signature:

getContentSearch(q?: string, refine?: Array<string>, sort?: Array<string>, start?: number, count?: number, locale?: string, options?: RequestOptions): Promise<PoqResponse<ContentSearchResult>>;

Parameters

Parameter Type Description
q string (Optional) The query phrase to search for.
refine Array<string> (Optional) Parameter that represents a refinement attribute/value(s) pair. Refinement attribute id and value(s) are separated by &#39;&#x3D;&#39;. Multiple values are supported by a sub-set of refinement attributes and can be provided by separating them using a pipe (URL encoded &#x3D; &quot;|&quot;). Value ranges can be specified like this: refine&#x3D;foo&#x3D;(100..500) Multiple refine parameters can be provided by adding an underscore in combination with an integer counter right behind the parameter name and a counter range 1..9. I.e. refine_1&#x3D;c_refinementType&#x3D;type1|type2|type3. The following system refinement attribute ids are supported: fdid: Allows to refine per single content folder id. Multiple folder ids are not supported.
sort Array<string> (Optional) Parameter that represents a sorting attribute/value(s) pair. Sorting attribute id and value are separated by &#39;&#x3D;&#39;. The value describes the sort direction. Possible values are &#39;asc&#39; and &#39;desc&#39;, for ascending or descending sort direction. I.e. sort&#x3D;c_myAttribute&#x3D;desc. Precondition: You have to select your sorting attributes in Business Manager &gt; YourSite &gt; Search Indexes &gt; Content Index &gt; Sorting Attributes.
start number (Optional) The result set index to return the first instance for. Default value is 0.
count number (Optional) The maximum number of instances per request. Default value is 25.
locale string (Optional) The locale context.
options RequestOptions (Optional) Override http request option.

Returns:

Promise<PoqResponse<ContentSearchResult>>