@bridgeline-digital/hawksearch-handlebars-ui
    Preparing search index...

    Interface HawkSearchConfig

    interface HawkSearchConfig {
        autocomplete?: {
            decodeQuery?: boolean;
            endpointUrl?: string;
            minCharacterCount?: number;
            recommendationsEnabled?: boolean;
        };
        breakpoints?: Breakpoints<number>;
        clientId: string;
        components?: HawkSearchComponents;
        css?: { customStyles?: string | string[]; defaultStyles?: boolean };
        debug?: boolean;
        fieldMappings?: FieldMappings;
        formatting?: { cultureIsoCode?: string; currencyIsoCode?: string };
        index?: string;
        placeholderImageUrl?: string;
        recommendations?: { endpointUrl?: string; useTitle?: boolean };
        search?: {
            decodeFacetValues?: boolean;
            decodeQuery?: boolean;
            desktopOnlyBanner?: 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;
        };
        seo?: { title?: { prefix?: string; suffix?: string } };
        shadowDom?: boolean;
        tracking?: { enabled?: boolean; endpointUrl?: string };
        urlPrefixes?: { assets?: string; content?: string };
        useCustomStyle?: boolean;
        variants?: {
            baseFacetCountOnVariants?: boolean;
            enabled?: boolean;
            fieldMappings?: VariantFieldMappings;
            fieldPrefix?: string;
            trackUsingVariant?: boolean;
        };
    }
    Index

    Properties

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

    Type Declaration

    • OptionaldecodeQuery?: 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.

      true

    • OptionalendpointUrl?: string

      The API used to retrieve search results

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

    • OptionalminCharacterCount?: number

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

      1

    • OptionalrecommendationsEnabled?: boolean

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

      false

    breakpoints?: Breakpoints<number>

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

    {
    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

    • OptionalcustomStyles?: 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.

    • OptionaldefaultStyles?: 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

    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

    • OptionalcultureIsoCode?: string

      'en-US'

    • OptionalcurrencyIsoCode?: string

      'USD'

    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; useTitle?: boolean }

    Type Declaration

    • OptionalendpointUrl?: string

      The API used to retrieve product recommendations

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

    • OptionaluseTitle?: boolean

      Specifies whether widget title should be used as title. As default it uses name attribute as title

      false

    search?: {
        decodeFacetValues?: boolean;
        decodeQuery?: boolean;
        desktopOnlyBanner?: 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

    • OptionaldecodeFacetValues?: boolean

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

      true

    • OptionaldecodeQuery?: 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.

      true

    • OptionaldesktopOnlyBanner?: boolean

      This would allow hide and show the desktop banner on mobile and tablet

      true

    • OptionalendpointUrl?: string

      The API used to retrieve search results

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

    • OptionalfacetExclusionPrefix?: 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.

      '-'

    • OptionalitemTypes?: { 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.

        'content'

      • OptionalproductValues?: string[]

        List of values that will be considered a product result.

        ['item', 'product']

    • OptionalkValue?: number

      Specifies a kValue for Concept and Image search

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

      Specifies which query string parameters are used

      • OptionaldisableSpellcheck?: string

        'disableSpellcheck'

      • Optionalpage?: string

        'page'

      • OptionalpageSize?: string

        'pageSize'

      • Optionalquery?: string

        'query'

      • OptionalrequestType?: RequestType

        Sets RequestType field to toggle between Keyword search, Image search or Concept search

        'DefaultSearch'

      • OptionalsearchWithin?: string

        'searchWithin'

      • Optionalsort?: string

        'sort'

    • Optionalurl?: string

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

      '/search'

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

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

    true

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

    Type Declaration

    • Optionalenabled?: boolean

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

      true

    • OptionalendpointUrl?: string

      The API used to track user interactions

      '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

    useCustomStyle?: boolean

    Specifies whether components should be rendered with custom style

    variants?: {
        baseFacetCountOnVariants?: boolean;
        enabled?: boolean;
        fieldMappings?: VariantFieldMappings;
        fieldPrefix?: string;
        trackUsingVariant?: boolean;
    }

    Type Declaration

    • OptionalbaseFacetCountOnVariants?: boolean

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

      false

    • Optionalenabled?: boolean

      Specifies whether variant logic should be used if data is available

      true

    • OptionalfieldMappings?: VariantFieldMappings

      Map item attributes to common object properties

    • OptionalfieldPrefix?: 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'.

    • OptionaltrackUsingVariant?: boolean

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

      false