Reference node table from file datasource

Created on 17 January 2020, almost 5 years ago
Updated 20 January 2023, almost 2 years ago

I am using search_api, search_api_solr and search_api_attachments.

I am indexing 3 entities: nodes, paragraphs and files.

I have created a Facet using the node Group title (field_node_group:entity:label). This lists the group titles from nodes in the search results.

node->group title->facet

However, I would also like the group titles from the files to be listed in the facet as well.

I have read up on hook_search_api_query_alter() and it does not appear to be designed for this task, at least with Solr searches: https://www.drupal.org/project/search_api/issues/2619882 β†’

Programmatically, from the file id I can retrieve the node (parent entity) it is attached to in order to retrieve the title of the group they belong to.

My question is: Is there a hook that would allow me to insert a value into field_node_group:entity:label so that it would appear in the facet results for relevant files in the search results?

In other words:

file->node->group title->facet

πŸ’¬ Support request
Status

Fixed

Version

1.4

Component

Search API integration

Created by

πŸ‡ΊπŸ‡ΈUnited States somebodysysop

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024