Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperSearch<ConfigParameters>

product search and helpful search suggestions.

Simple example:

  import { ShopperSearch } from "commerce-sdk-isomorphic";

  const clientConfig = {
    parameters: {
      clientId: "XXXXXX",
      organizationId: "XXXX",
      shortCode: "XXX",
      siteId: "XX"
    }
  };
  const shopperSearchClient = new ShopperSearch(clientConfig);
API Version: 1.0.41
Last Updated:

Type parameters

Hierarchy

  • ShopperSearch

Index

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/{version}/" = "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/{version}/"

Static Readonly paramKeys

paramKeys: { getSearchSuggestions: ["organizationId", "siteId", "q", "limit", "currency", "locale"]; getSearchSuggestionsRequired: ["organizationId", "siteId", "q"]; productSearch: ["organizationId", "select", "siteId", "q", "refine", "sort", "currency", "locale", "expand", "allImages", "perPricebook", "allVariationProperties", "offset", "limit"]; productSearchRequired: ["organizationId", "siteId"] } = {productSearch: ['organizationId','select','siteId','q','refine','sort','currency','locale','expand','allImages','perPricebook','allVariationProperties','offset','limit',],productSearchRequired: ['organizationId','siteId',],getSearchSuggestions: ['organizationId','siteId','q','limit','currency','locale',],getSearchSuggestionsRequired: ['organizationId','siteId','q',],} as const

Type declaration

  • getSearchSuggestions: ["organizationId", "siteId", "q", "limit", "currency", "locale"]
  • getSearchSuggestionsRequired: ["organizationId", "siteId", "q"]
  • productSearch: ["organizationId", "select", "siteId", "q", "refine", "sort", "currency", "locale", "expand", "allImages", "perPricebook", "allVariationProperties", "offset", "limit"]
  • productSearchRequired: ["organizationId", "siteId"]

Methods

getSearchSuggestions

  • getSearchSuggestions(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ currency?: undefined | string; limit?: undefined | number; locale?: undefined | string; organizationId: string; q: string; siteId: string } & {}, ConfigParameters> }>): Promise<SuggestionResult>
  • getSearchSuggestions<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ currency?: undefined | string; limit?: undefined | number; locale?: undefined | string; organizationId: string; q: string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : SuggestionResult>
  • Provides keyword search functionality for products, categories, and brands suggestions. Returns suggested products, suggested categories, and suggested brands for the given search phrase.

    If you would like to get a raw Response object use the other getSearchSuggestions function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ currency?: undefined | string; limit?: undefined | number; locale?: undefined | string; organizationId: string; q: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<SuggestionResult>

    A promise of type SuggestionResult.

  • Provides keyword search functionality for products, categories, and brands suggestions. Returns suggested products, suggested categories, and suggested brands for the given search phrase.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ currency?: undefined | string; limit?: undefined | number; locale?: undefined | string; organizationId: string; q: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : SuggestionResult>

    A promise of type Response if rawResponse is true, a promise of type SuggestionResult otherwise.

productSearch

  • productSearch(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; allVariationProperties?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; limit?: undefined | number; locale?: undefined | string; offset?: any; organizationId: string; perPricebook?: undefined | false | true; q?: undefined | string; refine?: Array<string>; select?: undefined | string; siteId: string; sort?: undefined | string } & {}, ConfigParameters> }>): Promise<ProductSearchResult>
  • productSearch<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; allVariationProperties?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; limit?: undefined | number; locale?: undefined | string; offset?: any; organizationId: string; perPricebook?: undefined | false | true; q?: undefined | string; refine?: Array<string>; select?: undefined | string; siteId: string; sort?: undefined | string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : ProductSearchResult>
  • Provides keyword and refinement search functionality for products. Only returns the product ID, link, and name in the product search hit. The search result contains only products that are online and assigned to site catalog.

    If you would like to get a raw Response object use the other productSearch function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; allVariationProperties?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; limit?: undefined | number; locale?: undefined | string; offset?: any; organizationId: string; perPricebook?: undefined | false | true; q?: undefined | string; refine?: Array<string>; select?: undefined | string; siteId: string; sort?: undefined | string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<ProductSearchResult>

    A promise of type ProductSearchResult.

  • Provides keyword and refinement search functionality for products. Only returns the product ID, link, and name in the product search hit. The search result contains only products that are online and assigned to site catalog.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; allVariationProperties?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; limit?: undefined | number; locale?: undefined | string; offset?: any; organizationId: string; perPricebook?: undefined | false | true; q?: undefined | string; refine?: Array<string>; select?: undefined | string; siteId: string; sort?: undefined | string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ProductSearchResult>

    A promise of type Response if rawResponse is true, a promise of type ProductSearchResult otherwise.

Generated using TypeDoc