Pushing 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>

See Folding results - One-Level Relationships.

Folding Embedded Items with the Coveo APIs Directly

In your Search API requests, specify the following:

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

See Handle folded results