Apply an Extension to a Source

An indexing pipeline extension (IPE) is a Python script that you add to your Coveo organization that customizes the way you include source items in your organization.

Once an indexing pipeline is available in your organization, from the Coveo Administration Console, you can easily apply the extension to a source so that it’s run for source items which go through the indexing pipeline.

An extension can be Common, applying to all item types of a source, or Specific, applying only to specified item types, in which case you must first define the item types available in your source.

To apply an extension to a source:

  1. Log in to the Administration Console (platform-ca | platform-eu | platform-au) as a member of a group with the required privileges to manage extensions in the target organization, if not already done.

  2. Ensure that your extension is available in your organization. If required, you can edit your indexing pipeline extension.

  3. On the Sources (platform-ca | platform-eu | platform-au) page, click the source that you want to apply your extension to, and then click More > Manage extensions in the Action bar.

  4. In the Add/Edit Source Extensions panel, select the Specific or Common tab, depending on which type of extension you would like to add.

    When applying a Specific extension, verify that the desired item types appear in the Item type list. If there are no item types listed, add the item type.

    Tip
    Leading practice

    To minimize indexing time, apply an extension only to applicable source item types.

  5. In the upper-right corner, click Add > Extension.

  6. From the Extension dropdown menu, within the Apply an Extension on Source Items panel, select the name of the extension that you want to apply to the source.

  7. Under Stage, select Pre-Conversion or Post-Conversion to determine at what indexing pipeline stage the extension runs.

  8. Under Action on Error, select Reject Document to prevent the items from indexing if there’s an error in the extension, or select Skip Extension if you want to index the items regardless of an error.

    Examples
    • Your extension adds metadata to items for facets and filters that aren’t business-critical. Select Skip Extension to ensure that the items are indexed regardless. You can fix the issue afterward and then refresh the source.

    • The extension adds permissions to items or adds a field which will hide the items from a specific audience. Select Reject Document to ensure that the items don’t advance in the indexing pipeline so that no sensitive content is indexed.

  9. Under Apply to, select All items (common) to run the extension for all source items.

    If you only want it to run for particular source items, select Specific item types and then check the boxes of the desired item types.

    • If you see The source must contain at least one item type when selecting Specific item types, you must first define them.

  10. (Optional) In the Conditions to apply parameter, enter one or more expressions respecting the condition syntax.

    Tip
    Leading practice

    To minimize indexing time when the extension is relevant only to specific source items that can’t be filtered by their item types, you should set a condition determining to which items the extension applies.

    Example

    You create an extension that seeks specific tags metadata values entered by end users to determine how to populate a products metadata with normalized product name values. Running this extension when an item has no tags metadata values would waste resources and decrease indexing speed.

    You add the condition NOT @tags=='' that’s true for an item only when its tags field isn’t empty.

  11. Click Add. The extension now appears under the Common or Specific tab, depending on your selection.

  12. Choose how you would like to save your changes:

    • Click Save and Rebuild to save your configuration changes, force all source items to go through the indexing pipeline, and run the extension.

    • Click Save when you want to make some other changes to the source configuration before rebuilding, or when you want to rebuild your source at a specific time in the future.

  13. Validate that your extension script ran properly:

    1. Ensure that the extension ran without errors by checking the Extensions page and, in particular, the Usage Statistics panel.

    2. Check whether your script affected the items as expected. For example, you can inspect items with the Content Browser.

    3. If your extension script writes error or troubleshooting logs, navigate to the Administration Console Log Browser (platform-ca | platform-eu | platform-au) page to find these logs.

Note

You can use the JSON tab to inspect your source extension configuration and perform more advanced configurations.