Hierarchy

  • HawkSearchConfig

Properties

breakpoints?: Breakpoints<number>

Specifies the minimum window widths that correspond to each breakpoint. This is used determine when certain content items are displayed.

Default Value

{
mobile: undefined,
tablet: 740,
desktop: 990
}
clientId: string

The unique ID for your installation found in the HawkSearch admin

Specifies component-specific configuration options

css?: {
    customStyles?: string | string[];
    defaultStyles?: boolean;
}

Specifies which styles should be loaded for each component

Type declaration

  • Optional customStyles?: string | string[]

    One or more style sets to be loaded. This can be either a URL to an external stylesheet, the ID of a template element wrapping around a style element, or a string containing CSS rules.

  • Optional defaultStyles?: boolean

    Specifies whether the default stylesheet should be loaded. This should generally be true except for with completely custom interfaces.

endpoints?: {
    recommendations: string;
    search: string;
    tracking: string;
}

Specifies which endpoints are called by each service

Type declaration

  • recommendations: string

    The API used to retrieve product recommendations

    Default Value

    'https://recs-dev.hawksearch.net/api/recommendation/v2'

  • search: string

    The API used to retrieve search results

    Default Value

    'https://searchapi-dev.hawksearch.net/api/v2'

  • tracking: string

    The API used to track user interactions

    Default Value

    'https://tracking-dev.hawksearch.net/api'

formatting?: {
    cultureIsoCode?: string;
    currencyIsoCode?: string;
}

Specifies how values should be formatted for different cultures

Type declaration

index?: string
itemTypes?: {
    default: SearchResultsItemType;
    productValues?: string[];
}

Specifies how search results should be classified

Type declaration

  • default: SearchResultsItemType

    If the value a search result item is missing a value for the field mapped to type, this value will be assumed.

    Default Value

    'content'

  • Optional productValues?: string[]

    List of values that will be considered a product result.

    Default Value

    ['item', 'product']

placeholderImageUrl?: string

The URL of an image to be loaded whenever an image fails to load for a search result item

queryStringMappings?: {
    disableSpellcheck?: string;
    facet?: string;
    page?: string;
    pageSize?: string;
    query?: string;
    searchWithin?: string;
    sort?: string;
}

Specifies which query string parameters are used

Type declaration

  • Optional disableSpellcheck?: string

    Default Value

    'disableSpellcheck'

  • Optional facet?: string

    This value is used as a prefix before the field name of the facet. For example, with the default value, if the field name is color, the query string parameter would become facet-color.

    Default Value

    'facet'

  • Optional page?: string
  • Optional pageSize?: string

    Default Value

    'pageSize'

  • Optional query?: string
  • Optional searchWithin?: string

    Default Value

    'searchWithin'

  • Optional sort?: string
recommendationsFieldMappings?: {
    description?: string;
    imageUrl?: string;
    price?: string;
    salePrice?: string;
    title?: string;
    url?: string;
}

Map item attributes to common object properties

Type declaration

searchResultsFieldMappings?: {
    description?: string;
    imageUrl?: string;
    price?: string;
    salePrice?: string;
    title?: string;
    type?: string;
    url?: string;
}

Map item attributes to common object properties

Type declaration

searchUrl?: string

The URL of your search results page. This is used to redirect users after performing a search.

Default Value

'/search'

shadowDom?: boolean

Specifies whether components should be rendered in the Shadow DOM. This is highly recommended to avoid CSS conflicts.

Default Value

true

trackingEnabled?: boolean

Specifies whether user actions should be tracked to provide valuable insights on your search engine performance

Default Value

true

urlPrefixes?: {
    assets?: string;
    content?: string;
}

If your data contains relative URLs, these values can be prepended to the values to convert them to absolute URLs

Type declaration

  • Optional assets?: string
  • Optional content?: string