Manage Trigger Rules

The instructions in this article apply to organizations that haven’t gone through the query pipeline migration process. If your organization has been migrated, you must manage trigger rules using the Advanced tab of a query pipeline configuration.

The list of query pipeline triggers for the index of a Coveo 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. Log in to the Coveo Platform as a member of a group with the required privileges to manage query pipeline components in the target Coveo organization, if not already done.

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

  3. On the Query Pipelines page, click the query pipeline in which you find the trigger rules you want to manage, 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’s 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 Manage Privileges 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. In the upper-right corner, click Add Rule to access the Add a Trigger Rule subpage.

    2. On the Add a Trigger Rule subpage, under Type, select one of the available methods (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’re 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.


      • 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. On the right-hand side, under Condition, you can optionally select a query pipeline condition in the drop-down menu or create a new one.

    5. Under User note, optionally enter a text with information that will help you and your colleagues to manage the rule in the future.

    6. 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 Action-Menu, and then select Add rule with code.

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

        3. Click Add With Code.

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

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

  6. In the search interface(s) for your Coveo 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

By default, members of the Administrators and Relevance Managers built-in groups can view and edit elements of the Query Pipelines page.

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

Action Service - Domain Required access level
View trigger rules

Search - Query pipelines

Edit trigger rules

Search - Query pipelines

Recommended Articles