Leveraging Entity Context in a Full Search Page

Coveo for Dynamics 1.1.180912.3 (September 2018)

When you embed an Insight panel in an entity form, the Insight panel typically takes a fraction of the entity page (see Adding a Coveo Search Page to an Entity View). The Full Search component allows you to open the search interface in a new window to browse and filter your search results in a larger space (see Full Search).

However, entity data context is not automatically loaded in the full search page, which causes discrepancies in the search results displayed. So, to load the entity context to the full search page and make the full search page results similar to those presented in the Insight panel, you must add a context facet to your Insight panel.

Full search page with context facet and Mark As Relevant button

By default, the Context Facet component loads the context of an entity to a full search page only if this entity is a case. In other words, if you follow the procedure below and do not edit the Context Facet component, the full search page will load entity context data and display the corresponding search result when opened from an Insight panel embedded in a case only.

If you want to load other entity data to full search page for context, you must add and configure a Context Facet accordingly. You must do so for every entity in which you embedded an Insight panel that can be expanded to a full search page with context.

To have an entity context transfer from an Insight panel to a full search page

  1. In the Coveo Cloud configuration page, in the menu on the left, click Search Pages V2 (see About the Configuration Interface).
  2. In the Search Pages page, double-click the search page embedded in your case page.
  3. In the search page Interface Editor, in the top-right corner, click Code View (see Interface Editor and Code View).
  4. In the panel source code, locate the <div class="coveo-facet-column"> line, and then, right underneath, insert the following line to add a Context Facet: <div class="CoveoContextFacet"></div>.
  5. Optionally, if you want to open a full search page with context from an Insight panel embedded in a non-case entity, edit the Context Facet:
    1. In the top-right corner, click UI View.
    2. Back in the UI view, in your Insight panel interface, click Filters.
    3. Hover over the Context Facet component (in blue) to select it, and then click the Edit button.

      Editing the Context Facet

    4. In the Context Facet Options panel:
      1. In the Entity logical name box, enter logical name of the entity of which you want to transfer the context.
      2. In the Identifier Attribute box, enter an attribute that uniquely identifies the entities.
      3. In the Attributes and the Additional Attributes boxes, enter the fields to load in the full search page. Among the fields that you entered in the Refined Query and Insight Context components to leverage entity context in the Insight panel, only those that you include in the Context Facet will be loaded and leveraged to improve search results relevance. In the Attributes box, enter short, entity-specific attributes to help users identify the entity in a glance. These attributes will be used for context in the full search page and displayed in the Context Facet.

        You create a Context Facet for your opportunities. Your Refined Query component uses {{ form.title }} and {{ form.description }}, while your Insight Context component uses {{ form.product }}. In the support case context facet, you enter {{ form.title }} and product, but leave out {{ form.description }}, as its content would be too long.

        In the Additional Attributes box, enter the fields that you want to load for context, but that you do not want to be displayed in the facet.

        {{ form.description }}

      4. Click Apply.

      The attribute type labels displayed in the Context Facet are localized strings. Some may therefore appear as, for instance, ADDRESS1_COUNTRY. If you want to customize these strings, see Customizing the Localization of a Search Interface.

  6. In the Interface Editor top-right corner, click Save, and then Quit.
  7. Back in the Search Pages page, publish your changes (see Publishing a Search page).
  8. To test your change, open a case page, and then, in the Insight panel, click the Full Search button (see Full Search). The search interface should open in a new window, and a new facet should this display the essential data of your case. You should also be able to use the Mark as Relevant result action (see Take Note component).

What’s Next?

Read more about Coveo Machine Learning and contextual queries (see Coveo Machine Learning and Contextual Queries).

Recommended Articles