How to make a facet search on a taxonomy term contained in a paragraph contained in a content type? On Drupal 8, I try to make a facet on a taxonomy term contained in a paragraph entity contained in a content type. Is it possible?
My stack : Druapl 8.9.0 + Search API 8.x-1.17 + Facets 8.x-1.5
In Search API, I have indexed the taxonomy from the paragraph. In database I have a new table with 2 columns entity and taxonomy. It seems OK to link node with paragraph with taxonomy id.

I have created the facet without problem but it does not display on my search page.
Is someone has realized this before? Or maybe a advise to resolve this problem.
A solution is to associate the taxonomy directly with the content type (field_ingredient_search_index in the example below) and make a hook to update it automatically.
$nodeTerms = []; // 1,2,3 = terms IDs
$erase = [];
$node-&gt;set('field_ingredient_search_index', $erase);
    
foreach ($node-&gt;get('field_liste_ingredients')-&gt;referencedEntities() as $enty){
    
  if($enty-&gt;getParagraphType()-&gt;id == 'ingredient' &amp;&amp; isset($enty-&gt;get('field_ingredient')-&gt;target_id)) {
      $nodeTerms[] = $enty-&gt;get('field_ingredient')-&gt;target_id;
  }
    
}
    
$node-&gt;set('field_ingredient_search_index', $nodeTerms);