Understanding the Advanced Lightning Configuration Options

This page presents options and screenshots from the Coveo for Salesforce Free edition. For documentation specifically targeted at Coveo for Salesforce Pro and Enterprise users, see Adding Server-Side Coveo Lightning Component Configuration.

Changing options in the Advanced Lightning Configuration page generates a special configuration in the CoveoLightningSettings__c custom object.

The object and the field should be accessible (in read-only) by all users of the site.

The object and the field should be writable only by a user with an administrative role in Salesforce.

If the object is not configured correctly, there will be an Unsufficient read access to Coveo Lightning Configuration object error page.

In a community, when selecting a Coveo component, the communityCoveo box offers three options:

With Coveo for Salesforce v3.25+ With Coveo for Salesforce V3 With Coveo for Salesforce V2
  • Edit: Allows access to the JavaScript Interface Editor (see Interface Editor).
  • Delete: Deletes the component.
  • Advanced Lightning Configuration: Edits Server-Side configuration.

Selecting the last option leads to the following page, allowing you to edit certain things to do with the search token:

Here, you can edit server-side configurations of the search token, which is cryptographically secured so that it cannot be interfered with client code. Here are the available options.

These configurations are saved in a Salesforce custom object (CoveoLightningSettings__c). This object MUST be properly configured in Salesforce for security reasons.

This means that the object MUST be readable by all the user of the site, and MUST be writable only by administrative users in your Salesforce instance.

Each site in your Salesforce instance can contain a different configuration, and each Coveo component in each site can contain a different configuration.

The Name attribute on the Coveo Lightning component is used to determine which configuration should be applied to which component (see Base Lightning Component - name and Searchbox Lightning Component - name).

For a given site:

  • If you have no configuration for any Coveo component, then a search token with no special configuration will be sent to the Lightning components
  • If you have a configuration for a Coveo component (using the name as the key), then a search token will be sent to the corresponding components.
  • If you have a configuration for at least one Coveo component (using the name as the key), then ALL components on your site must also contain a configuration. This can be the exact same configuration. It must however be explicitly configured for each and every component in your site. Otherwise, any component that are not configured will refuse to initialize and will output the following error message: No configuration for the current Component

Query Expression

Enter a query expression in this field to add it to all queries of that component.

You want a component that only searches through your cases and accounts.

In the Query Expression section, you enter the following expression:

@objecttype==(Case) OR @objecttype==(Account)

Anonymous User

This determines the user identity to be used when a user that is not logged in uses Coveo components.

This is especially useful with the Coveo for Salesforce Free edition, as a guest user needs to be created in order to enable API usage, else no query can be returned (see Creating a Guest User Profile for Your Community).

You created the anonymous@myorganization.com guest user profile that you want to use whenever non-connected users interact with the Coveo components.

In the Anonymous User section, you enter the guest user e-mail:

anonymous@myorganization.com

Additional User Identities

This option allows you to add user identities to the current user performing queries. This is done to allow them to have access to items their current identity does not have access to.

Usage Analytics Group

This option allows you to add context to the analytics sent to Coveo Cloud.

You want the analytics of your Coveo component to be sent using the custom group Sales, for easier classification and searchability in Usage Analytics.

Under Usage Analytics Group, you enter Sales.

Bypass Above Settings to Rather Generate the Search Token from a Custom Apex Class

Checking this box bypasses the settings and uses a custom Apex class.

To learn how to create a custom Apex class, see Send Apex Context to a JavaScript Search Interface.