0

I'm using an content node type (let's say "A") with file attachments.

For search functionality the attachments are being indexed by "Search API" and "Search API Attachments".

At the search result view I want to view fields of the parent of a found file. How to achieve this?

For example: If a search results in a file, the result page should view fields from the containing parent node (type "A"), for instance the title of the parent node.

Sysout
  • 91
  • 6

1 Answers1

0

You can add relationships down in your index, but not up, so you probably want to index the parent content, and then add fields to your index which have a relationship to the file > filename. That way the filename is indexed (other other file entity fields), but the result you're return is the parent node.

You could then use a search result view mode to select which parent node fields you want to feature in the result.

Docs - https://www.drupal.org/docs/8/modules/search-api/getting-started/adding-an-index