CommunitySearchBox Lightning Component

The CommunitySearchBox Lightning component lets you change the search box in your Lightning community.

It takes care of wrapping and including the correct scripts and different resource references needed to do so.

Usage

Reference it in your Lightning component as you would for any other Aura component, using the namespace prefix of the Coveo package.

<aura:component implements='forceCommunity:searchInterface'>
  <CoveoV2:CommunitySearchBox/>
</aura:component>

Resources Included With This Component

This component includes the Coveo JavaScript Search Framework, the jQuery (latest 3.x.x version) library, and the Coveo for Salesforce specific assets.

Note

Since Lightning Locker is automatically enabled on this component, the underscore result templates aren’t supported. You must use HTML templates instead.

Aura Event

This component doesn’t offer any Aura events.

Options

The component offers the following options:

name

The name of the Coveo Search component you want to associate to your search box.

Default value is communitySearchCoveo.

Note

It’s good practice to use the same name value as your Community Search component.

searchHub

The name of the search hub used for Coveo Usage Analytics (Coveo UA) reports.

Default value is the same value as name.

Note

It’s good practice to use the same searchHub value as your Community Search component.

placeholder

The placeholder text to put in the search box when no query is entered.

Default value is empty.

triggerQueryOnClear

Specifies whether to trigger a query when the search box is cleared.

Default value is true.

enableQuerySyntax

Specifies whether special characters should be interpreted as Coveo Query Syntax (see Querybox - enableQuerySyntax).

Default value is false.

enableQuerySuggestAddon

Specifies whether to enable Coveo Machine Learning (Coveo ML) for query suggestions (see Omnibox - enableQuerySuggestAddon).

Default value is true.

searchPageName

The page where your search box should redirect.

Depending on your Salesforce version, the value should either be:

Before Winter '18: search/all/home/%40uri

Winter '18 and up: global-search/%40uri

debug

Whether to use the non-minified versions of the different resources.

Default value is false.

facetValueSuggestFields

Provides end users with scoped query suggestions based on the values of a specific facet-enabled field (see Facet Value Suggestion Fields).

Default value is empty.