Hierarchy

  • HawkSearchConfig

Properties

autocomplete?: {
    decodeQuery?: boolean;
    endpointUrl?: string;
    minCharacterCount?: number;
    recommendationsEnabled?: boolean;
}

Type declaration

  • Optional decodeQuery?: boolean

    Whether to automatically URI decode the search query value. Runs recursively until value is fully decoded. For example, Test%2520Value would become Test Value.

    Default Value

    true

  • Optional endpointUrl?: string

    The API used to retrieve search results

    Default Value

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

  • Optional minCharacterCount?: number

    Specifies the minimum length for a query to trigger an autocomplete recommendations request.

    Default Value

    1

  • Optional recommendationsEnabled?: boolean

    Specifies whether autocomplete recommendations (autocomplete without entering a query - "instant engage") is enabled

    Default Value

    false

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.

debug?: boolean

Specifies whether search queries should be displayed on console

Default Value

false

fieldMappings?: FieldMappings

Map item attributes to common object properties

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

Specifies how values should be formatted for different cultures

Type declaration

index?: string

Specify an index to query rather than the default

placeholderImageUrl?: string

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

recommendations?: {
    endpointUrl?: string;
}

Type declaration

  • Optional endpointUrl?: string

    The API used to retrieve product recommendations

    Default Value

    'https://recs-dev.hawksearch.net'

search?: {
    decodeFacetValues?: boolean;
    decodeQuery?: boolean;
    endpointUrl?: string;
    facetExclusionPrefix?: string;
    itemTypes?: {
        default: ItemType;
        productValues?: string[];
    };
    kValue?: number;
    queryStringMappings?: {
        disableSpellcheck?: string;
        page?: string;
        pageSize?: string;
        query?: string;
        requestType?: RequestType;
        searchWithin?: string;
        sort?: string;
    };
    url?: string;
}

Type declaration

  • Optional decodeFacetValues?: boolean

    Whether to automatically URI decode facet selection values. Runs recursively until value is fully decoded. For example, Test%2520Value would become Test Value.

    Default Value

    true

  • Optional decodeQuery?: boolean

    Whether to automatically URI decode the search query value. Runs recursively until value is fully decoded. For example, Test%2520Value would become Test Value.

    Default Value

    true

  • Optional endpointUrl?: string

    The API used to retrieve search results

    Default Value

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

  • Optional facetExclusionPrefix?: string

    The prefix for values sent to the API when excluding a facet. This is only modified in rare circumstances where the project has facet values starting with a hyphen.

    Default Value

    '-'

  • Optional itemTypes?: {
        default: ItemType;
        productValues?: string[];
    }

    Specifies how search results should be classified

    • default: ItemType

      If the value a search result item is missing a value for the field mapped to fieldMappings.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']

  • Optional kValue?: number

    Specifies a kValue for Concept and Image search

  • Optional queryStringMappings?: {
        disableSpellcheck?: string;
        page?: string;
        pageSize?: string;
        query?: string;
        requestType?: RequestType;
        searchWithin?: string;
        sort?: string;
    }

    Specifies which query string parameters are used

  • Optional url?: string

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

    Default Value

    '/search'

seo?: {
    title?: {
        prefix?: string;
        suffix?: string;
    };
}

Type declaration

  • Optional title?: {
        prefix?: string;
        suffix?: string;
    }
    • Optional prefix?: string

      Value prepended to title returned from API

    • Optional suffix?: string

      Value appended to title returned from API

shadowDom?: boolean

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

Default Value

true

tracking?: {
    enabled?: boolean;
    endpointUrl?: string;
}

Type declaration

  • Optional enabled?: boolean

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

    Default Value

    true

  • Optional endpointUrl?: string

    The API used to track user interactions

    Default Value

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

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
variants?: {
    baseFacetCountOnVariants?: boolean;
    enabled?: boolean;
    fieldMappings?: VariantFieldMappings;
    fieldPrefix?: string;
    trackUsingVariant?: boolean;
}

Type declaration

  • Optional baseFacetCountOnVariants?: boolean

    When true, specifies that facet counts should be calculated based on the number of child items rather than the number of parent items

    Default Value

    false

  • Optional enabled?: boolean

    Specifies whether variant logic should be used if data is available

    Default Value

    true

  • Optional fieldMappings?: VariantFieldMappings

    Map item attributes to common object properties

  • Optional fieldPrefix?: string

    When specified, this prefix is removed from the attributes collection on variant items. For example, if a value of 'child_' is used and HawkSearch returns a field named 'child_color', it will be transformed to 'color'.

  • Optional trackUsingVariant?: boolean

    When true, specifies that tracking should use the ID of the selected variant rather than the ID of the parent

    Default Value

    false