Poq.SDK.Node

Home > @poq/sdk-sfcc > IProductSearchClient > getProductSearch

IProductSearchClient.getProductSearch() method

Provides keyword and refinement search functionality for products. Only returns the product id, link and name in the product search hit. Other search hit properties can be added by using the expand parameter. The search result contains only products that are online and assigned to site catalog. This resource does not return detailed information about variation products. If a variation product matches the query, basic information for the parent master product is returned. Use the products resource to retrieve more details about a variation product.

Signature:

getProductSearch(q?: string, refine?: Array<string>, sort?: string, start?: number, count?: number, expand?: Array<string>, currency?: string, locale?: string, options?: RequestOptions): Promise<PoqResponse<ProductSearchResult>>;

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;price&#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_refinementColor&#x3D;red|green|blue. The following system refinement attribute ids are supported: cgid: Allows to refine per single category id. Multiple category ids are not supported. price: Allows to refine per single price range. Multiple price ranges are not supported. pmid: Allows to refine per promotion id(s). htype: Allow to refine by including only the provided hit types. Accepted types are &#39;product&#39;, &#39;master&#39;, &#39;set&#39;, &#39;bundle&#39;, &#39;slicing_group&#39; (deprecated), &#39;variation_group&#39;. orderable_only: Unavailable products will be excluded from the search results if true is set. Multiple refinement values are not supported.
sort string (Optional) The id of the sorting option to sort the search hits.
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.
expand Array<string> (Optional) The expand parameter. A comma separated list with the allowed values (availability, images, prices, represented_products, variations)
currency string (Optional) The currency mnemonic specified for price. This parameter is effective only if specified expand parameter value contains prices.
locale string (Optional) The locale context.
options RequestOptions (Optional) Override http request option.

Returns:

Promise<PoqResponse<ProductSearchResult>>