Export and import query pipeline elements

When you’ve created query pipeline elements, such as rules and Coveo Machine Learning (Coveo ML) models, and tested their effectiveness, you may want to reuse them in different pipelines. The import and export features allow members with the required privileges to copy query pipeline elements and reuse them in another query pipeline or Coveo organization.

Note

Coveo ML models can only be imported and exported within the same organization.

Access the "Import" or "Export" panel

On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the desired pipeline, and then click More > Import or Export in the Action bar.

Export query pipeline elements

  1. Access the "Export" panel.

  2. In the Export panel, select the type of pipeline element you want to export.

    Export Panel
  3. Click Export.

Note

The data is exported to a CSV file in the Downloads folder of your browser.

Import query pipeline elements

  1. Access the "Import" panel.

  2. In the Import/Export panel:

    1. Click Select a file, and then select the desired CSV file.

    2. Select the type of query pipeline element to import from the selected file.

    3. Click Import.

      Import Panel
Important

Importing query pipeline rules overwrites existing rules. For example, importing thesaurus rules from another query pipeline will overwrite any existing thesaurus rules in the current query pipeline.

Creating CSV files for importation

If you have a set of rules that you want to create for your organization, you can write them all in a CSV file which you can then import into your pipeline. This allows you to import multiple rules at once without having to manually create them using the [Query_Pipeline_Name] page.

You can use the following template in a spreadsheet to create your rules:

CSV

Definition

In this column, enter rules using the proper query pipeline language (QPL) syntax:

Condition

In this column, enter rules using the proper QPL syntax.

Description

In this column, you can enter a message to be displayed in the Description column of the [Query_Pipeline_Name] page.

Feature

In this column, enter the Search API name of the query pipeline feature you’re creating.

Once you’ve properly formatted your spreadsheet, ensure that you save the document in the CSV file format. You can then use this document to import your query pipeline elements.

Exporting and importing query pipeline rules between organizations

Important

You can’t import Coveo ML models from a different organization.

You may have more than one Coveo organization, typically a sandbox organization and a production organization. Once you’ve tested a given query pipeline configuration change in your sandbox organization, you may want to apply this change to your production organization.

If you recreate your configuration changes from scratch in the production organization, there’s a risk of introducing errors. Instead, you should use the exportation and importation features to transfer pipeline elements from one organization to another.

  1. Access the Coveo organization from which you want to import query pipeline rules, and then access the "Import" or "Export" panel.

  2. Export the desired query pipeline rules.

  3. Switch to the organization in which you want to import the pipeline rules.

  4. Access the "Import" or "Export" panel.

  5. Import the desired query pipeline rules.