THIS IS ARCHIVED DOCUMENTATION

Add the Coveo Hosted Search Page component to your site

Warning

Coveo ended support for the Coveo Hosted Search Page package in February 2023. This package should no longer be used.

For recipes on how to index Adobe Experience Manager content and add search interfaces in your AEM websites, see Coveo for Adobe.

You now have a classic hosted search page. The next step is to insert the Coveo Hosted Search Page component in a web page to pull the HTML from your classic hosted search page and inject it into the web page.

Install the package

To install the Coveo Hosted Search Page Beta package

  1. Get the package.

  2. In the author instance CRX Package Manager, upload and install the coveo-aem-components.all-<VERSION>.zip package.

    Uploading the Coveo package in the Package Manager
    Installing the Coveo package in the Package Manager
  3. In order for the hosted search page to work on your publish instance, replicate the coveo-aem-components.all-<VERSION>.zip package.

    Replicating the Coveo package in the Package Manager

Add the component to allowed components on a template

Once the package installed, you can add the Coveo Hosted Search Page component as an allowed component on the template you’ll use to create your main search page, whether an existing template or a duplicate of an existing template.

  1. In the author instance user interface, open the template you want to allow the Coveo Hosted Search Page component on.

    Opening the template to edit its layout container policy
  2. Select the Layout Container, and then select the Policy option.

    Accessing template layout container policies
  3. Under Properties, in the Allowed Components tab, select Coveo Components - Content. Click check in the upper-right corner to save your changes.

    Adding Coveo Hosted Search Page component as allowed component

Create API keys and collect component configuration IDs

To retrieve your Coveo organization hosted search page code and to run search queries, the Coveo Hosted Search Page component needs to be configured with the following information:

  • The Coveo endpoint URI

  • Your organization ID

  • An access API key

  • A search API key

  • The classic hosted search page ID

The following steps explain how to create and configure the two API keys. While in your organization, you’ll also collect the five component configuration parameters.

  1. Open the API Keys (platform-ca | platform-eu | platform-au) page in your Coveo organization.

  2. Click Add key in the upper-right corner of the page.

  3. In the Add an API key dialog, in the Configuration tab, set the Key name to Access API Key.

    Naming the access API key | Coveo
  4. Select the Privileges tab.

  5. Select the Search domain on the left side, and then set the Search pages resource access level to View all.

    Setting the access API key privileges | Coveo
  6. Click Add key.

  7. In the Your API Key dialog, click Copy.

    Copying the access API key | Coveo
  8. Paste your access API key in a safe location. This is the first of five parameters required to configure your Coveo Hosted Search Page component.

  9. Repeat the previous steps to create the search API key. Name it Search API Key and, in the Privileges tab, provide the following access levels:

    Domain Resource Access level

    Search

    Execute queries

    Allowed

    Search

    Impersonate

    Allowed

    Tip
    Leading practice

    To follow leading security practices, you should limit the scope of your search API key to a given search hub before clicking Add key at the bottom of the modal.

    Limiting the API key scope | Coveo
  10. Copy your search API key and paste it in a safe location.

  11. On the Search Pages (platform-ca | platform-eu | platform-au) page, click the classic hosted search page you want to use, and then click Copy ID in the Action bar.

  12. Paste the hosted search page ID in a file so you can retrieve it later.

  13. Get the organization ID from the URL and paste it in a file so you can retrieve it later.

    Example

    A user is viewing the Search Pages page. The URL is https://platform.cloud.coveo.com/admin/#/ourorgkkkybs20/search/search-pages

    The organization ID is ourorgkkkybs20.

  14. Get the platform endpoint URL and paste it in a file so you can retrieve it later.

    Example

    A user is viewing the Search Pages page. The URL is https://platform.cloud.coveo.com/admin/#/ourorgkkkybs20/search/search-pages

    The platform endpoint URL is https://platform.cloud.coveo.com.

Encrypt the API keys

We recommend that you encrypt your Coveo organization API keys in all your instances. Since encryption keys are instance specific, this can be achieved by doing one of the following:

  • (Recommended) Encrypt the Coveo organization API keys on the author instance and share the author instance encryption keys with the publish instance(s).

  • Encrypt the Coveo organization API keys directly in the publish instance(s).

    Important

    Opting to encrypt Coveo organization API keys directly in the publish instance(s) has an important drawback. You’ll need to re-encrypt your API keys each time you publish the author instance Adobe Experience Manager page, as this overwrites the Coveo Hosted Search Page component configurations on the publish instance.

To encrypt the Coveo organization API keys on the Adobe Experience Manager author instance and share the author instance encryption keys

  1. In your Adobe Experience Manager instance, open page https:<AUTHOR_DOMAIN>/system/console/crypto.

  2. Paste your Access API Key in the Plain Text field.

  3. Click Protect.

    Using Crypto Support to encrypt the API keys
  4. Copy and paste the content of the Protected Text field in the same location you used for the other Coveo Hosted Search Page component configuration parameters.

  5. Repeat the previous steps but, this time, to encrypt the Search API Key.

  6. Copy the hmac and master files of the com.adobe.granite.crypto.file bundle from the author instance to the publish instance(s). If necessary, see Make Sure You Properly Replicate Encryption Keys When Needed for further details.

Add and configure the component

You can now create a page using the template in which you allowed the Coveo Hosted Search Page component. The Coveo Hosted Search Page component also needs to be configured with the information you collected to access your Coveo organization hosted search page.

The following instructions assume that you’ve replicated the encryption keys from your author instance to your publish instance(s).

  1. In the author instance, in the Adobe Experience Manager UI, create a page using the template you created or updated.

    Creating a page using the template
  2. Once created, open your page.

    Opening the created page
  3. On the page, select the Layout Container, and then select Insert component.

    Inserting the component
  4. In the Insert New Component dialog, select the Coveo Hosted Search Page component.

  5. On the page, select the Coveo Hosted Search Page component, and then select the Configure option.

    Selecting the Configure option
  6. In the Properties dialog, use the parameter values you copied in the Create API keys and collect component configuration IDs section to set the component property values. Click check to save your changes.

    Configuring the component
    Important

    Set a meaningful Search Hub value (see Set the search hub).

  7. Refresh your page.

    You should now see your Coveo organization hosted search page in your Adobe Experience Manager web page.

    The Coveo Hosted Search Page component appears on the Adobe Experience Manager page
    Important

    Ensure the search result hyperlink URLs reflect the DNS of your public site.

    If, instead, you see an error message, start by checking the following:

  8. Publish your page.

Your published page should render without errors. If there are errors, ensure that there isn’t an API key encryption issue.

What’s next?

All the Coveo magic happens behind the scenes, between the moment a user performs a search in a Coveo-powered search interface and when the results are displayed. You’ll want to leverage the power of Coveo to the fullest extent, especially the Query pipeline and Coveo Machine Learning (ML) features.