Leveraging Query Pipeline Custom Context Information in Salesforce with the Legacy Interface Editor

This page describes how to add custom pipeline context using the legacy Interface Editor. To learn how to do the same with the newer Coveo Interface Editor, see Adding Pipeline Context to a Search Page Using the Interface Editor.

A Coveo JavaScript search interface such as one integrated in Coveo for Salesforce can pass custom context information (key/value pair) along with the query. You can then use this information in your Coveo Cloud Organization to conditionally apply specific query pipeline rules.

You configure a Coveo JavaScript search interface available in a Salesforce page to pass the Salesforce user type along with the query. In your Coveo Organization, you create query pipeline conditions (such as UserType is Partner and UserType is Customer) and apply these conditions to thesaurus rules, so that more appropriate synonyms are expanded for each user type.

To leverage query pipeline custom context information in Salesforce

  1. Using an administrator account, access your Coveo JavaScript search page or panel for which you want to manage custom context information.

  2. Coveo JavaScript Search Framework 1.0.139 - November 2015  Ensure that the JavaScript Search Framework powering your search page is version 1.0.139+ (see Identifying the Coveo JavaScript Search Version).

    For prior versions, if you have developer skills, you can add JavaScript code to the search page that has the same effect (see How to Leverage Custom Context Attributes in the Query Pipeline).

  3. Open the Interface Editor for your search page or panel (see Accessing the Coveo Legacy Interface Editor in Salesforce).

  4. Depending on the type of search page or panel, in the Interface Editor, click either the Visible or Hidden tab to find and then click the Pipeline context component to add it to the page.

    SFIntV2-IntEdtPipelineContext0

  5. Click the All Components tab to expand the list of all the components (both visible and hidden) present in the page.

  6. In the list of all components, click the Pipeline context component.

  7. In the Pipeline context component configuration panel, add a context information key/value pair:

    1. Click the Add Pipeline Context black bar.

      A set of Key and Value boxes appear.

      SFIntV2-IntEdtPipelineContext2

    2. In the Key box, enter a string of your choice to identify the value to pass.

      You will use this name later when you will define a query pipeline condition based on this contextual information.

    3. In the Value box, start typing to see matching values such as Salesforce field names or CurrentUrl appearing in a drop-down menu under the box, and then pick the desired one.

      Select CurrentUrl to create a query pipeline rule that applies only when the search is performed from a specific Salesforce page, such as from your support page.

    4. Optionally add other key/value pairs.

  8. Click the Draft tab, and then the Publish Draft button to make the changes effective.

  9. Access the Coveo Cloud administration console for the Coveo Cloud Organization to which your search interface is sending queries, and add one or more conditions based on the new Context information (see Managing Query Pipeline Conditions).

    Select Context in the first drop-down menu, type your context key, select an operator, and then type the context value.

    Admin-ConditionContext2

    The condition rule beside is met when the UserType context value is Partner.

  10. Apply the new condition to the desired query pipeline rule such as to a thesaurus rule (see Managing Query Pipeline Rules and Rule Conditions From Tabs).