Push embedded documents

The Coveo indexing pipeline can automatically detect and index certain kinds of embedded documents (for example, Excel spreadsheets embedded in Word documents).

In doing so, the index populates a set of fields which establish a single-level parent-child relationship between the parent document and its embedded children:

  • @topparent: The parent in the given parent-child relationship.

  • @isattachment: Populated in child items only. If present, has the same value as @topparent.

  • @containsattachments: Populated in parent items only. If present, has the same value as @topparent.

It’s possible to leverage those fields in result folding.

Folding embedded items with the JavaScript Search Framework

Use a FoldingForThread component, setting the following options:

<div class="CoveoFoldingForThread"
     data-field="@topparent"
     data-child="@containsattachment"
     data-parent="@isattachment"></div>

Folding embedded items with the Coveo APIs directly

In your Search API requests, specify the following:

...
"filterFIeld": "@topparent",
"parentField": "@containsattachments",
"childField": "@isattachment",
...