Adding and Managing Query Pipeline Triggers

The list of query pipeline triggers for the index of a Coveo Cloud organization is empty by default, you can add trigger rules. Trigger rules are defined independently for each pipeline.

The following diagram highlights the position of trigger rules in the overall order of execution of query pipeline features.

Apply trigger rules

Access the “Triggers” Tab of a Pipeline

  1. If not already done, log in to the Coveo Cloud platform as a member of a group with the required privileges to manage query pipeline components in the target Coveo Cloud organization.

  2. In the main menu on the left, under Search, select Query Pipelines.

  3. On the Query Pipelines page, access the query pipeline in which you find the trigger rules you want to manage:

    • Double-click the pipeline.

      OR

    • Click the pipeline, and then in the Action bar, click Edit components.

  4. On the selected pipeline page, select the Triggers tab.

Manage the Triggers of a Query Pipeline

  • Triggers are ignored when there is no condition on the trigger rule.

  • Members with the privilege to view query pipelines (i.e., the View all or the Custom access level on the Query Pipelines domain) can review trigger rules in read-only mode (see Privilege Management and Query Pipelines Domain).

  1. Ensure that the Coveo JavaScript Search Framework version that you use supports query pipeline triggers:

  2. Access the “Triggers” tab of a pipeline.

  3. In the Triggers tab, you can add a new trigger rule:

    1. Access the Add a Trigger Rule dialog by clicking Add Rule, and then selecting Triggers rule.

    2. In the Add a Trigger Rule dialog, select one of the following method (Notify, Query, Execute, or Redirect).

    3. Depending on the method you choose, the possible parameters are:

      • When you select Notify:

        In the String box, enter a message to be displayed in the search interface.

        On your internal search page for parts, each time a query is performed without a model number, you want to show Add a model number to your query to the user.

      • When you select Query:

        In the Query box, enter a query to be performed as a new search in the search interface.

        This method can be used as a custom Did You Mean feature or a thesaurus.

      • When you select Execute:

        In the Function box, enter a JavaScript function to be run in the client browser.

        • Your user searches webcam. Since this query can refer to any model, you create a function to generate a carousel of webcams each time webcam is queried, and then let the user select the one they are looking for.

        • When your users search your product names, you want a section to appear on top of the search results that include a download link and links to the product documentation guides.

          Admin-TriggerEx

      • When you select Redirect:

        In the URL box, enter a URL to be redirected to in the client browser.

        For certain queries, you always want a specific Web page to be opened. A user searching find stores is automatically redirected to your Store Finder page instead of being shown search results that contain the phrase find stores.

    4. Click Add Rule.

      • All changes are now effective.

      • For developers, you can also directly enter a rule that respects the Query Pipeline Language (QPL) syntax for triggers (see Trigger):

        1. In the Triggers tab, click Add Rule, and then select Triggers with code.

        2. In the Add a Rule With Code dialog, in the form editor box, enter a trigger rule.

        3. Click Add Rule.

  4. You can perform other actions on rules (see Adding and Managing Query Pipeline Rules and Rule Conditions From Tabs).

  5. You must add a condition to your trigger rule, otherwise the rule is ignored (see Adding and Managing Query Pipeline Conditions).

  6. In the search interface(s) for your Coveo Cloud organization:

    1. Ensure that the following div element is present (see Coveo Component Triggers):

      <div class="CoveoTriggers"></div>
      
    2. Test your trigger rule to ensure that it provides the desired outcome. Make adjustments when needed.

Required Privileges

The following table indicates the required privileges to view and edit elements of the Query Pipelines page and associated panels (see Privilege Management and Privilege Reference).

Action Service - Domain Required access level
View trigger rules

Search - Query pipelines

View
Edit trigger rules

Search - Query pipelines

Edit
Recommended Articles