Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperDiscoverySearch<ConfigParameters>

Einstein-powered product search and search suggestions.

Simple example:

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

  const clientConfig = {
    parameters: {
      clientId: "XXXXXX",
      organizationId: "XXXX",
      shortCode: "XXX",
      siteId: "XX"
    }
  };
  const shopperDiscoverySearchClient = new ShopperDiscoverySearch(clientConfig);
API Version: 1.1.6
Last Updated:
beta

Type parameters

Hierarchy

  • ShopperDiscoverySearch

Index

Constructors

constructor

Properties

clientConfig

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

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/discovery/query/{version}" = "https://{shortCode}.api.commercecloud.salesforce.com/discovery/query/{version}"

Static Readonly paramKeys

paramKeys: { getSuggestions: ["organizationId", "channelId", "suggestionTypes", "searchText", "locale"]; getSuggestionsRequired: ["organizationId", "channelId", "suggestionTypes", "locale"]; retrieveResults: ["organizationId", "channelId", "locale", "offset", "limit"]; retrieveResultsRequired: ["organizationId", "channelId", "locale"] } = {retrieveResults: ['organizationId','channelId','locale','offset','limit',],retrieveResultsRequired: ['organizationId','channelId','locale',],getSuggestions: ['organizationId','channelId','suggestionTypes','searchText','locale',],getSuggestionsRequired: ['organizationId','channelId','suggestionTypes','locale',],} as const

Type declaration

  • getSuggestions: ["organizationId", "channelId", "suggestionTypes", "searchText", "locale"]
  • getSuggestionsRequired: ["organizationId", "channelId", "suggestionTypes", "locale"]
  • retrieveResults: ["organizationId", "channelId", "locale", "offset", "limit"]
  • retrieveResultsRequired: ["organizationId", "channelId", "locale"]

Methods

getSuggestions

  • getSuggestions(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channelId: string; locale: string; organizationId: string; searchText?: undefined | string; suggestionTypes: Array<string> } & {}, ConfigParameters> }>): Promise<Suggestions>
  • getSuggestions<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channelId: string; locale: string; organizationId: string; searchText?: undefined | string; suggestionTypes: Array<string> } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : Suggestions>
  • This method gets suggestions for the user's search activity for a channel.

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

    beta

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channelId: string; locale: string; organizationId: string; searchText?: undefined | string; suggestionTypes: Array<string> } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<Suggestions>

    A promise of type Suggestions.

  • This method gets suggestions for the user's search activity for a channel.

    beta

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channelId: string; locale: string; organizationId: string; searchText?: undefined | string; suggestionTypes: Array<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 : Suggestions>

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

retrieveResults

  • This method retrieves search results for a Channel.

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

    beta

    Parameters

    Returns Promise<QueryOutput>

    A promise of type QueryOutput.

  • This method retrieves search results for a Channel.

    beta

    Type parameters

    • T: boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{ body: QueryInput; headers?: undefined | {}; parameters?: CompositeParameters<{ channelId: string; limit?: undefined | number; locale: string; offset?: any; organizationId: 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 : QueryOutput>

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

Generated using TypeDoc