How to reference groups from content in a search api index?

Created on 7 October 2024, 2 months ago

I have a search api solr view listing content (nodes) which is assigned to groups. I would like to output the groups the content has been assigned to as fields, and also include an exposed filter where you can either type the name of the group or ideally have a select list of the available groups.

I can't see how to make this data available?

With the "Reverse entity references" processor enabled in the search index, I can see when adding fields that against the "Content" entity there is "Reverse reference: Group relationship using Parent group (type "entity:group_relationship")", which sounds like the right thing, however this is listed under the "skippable fields" so it can't be added to the index.

Under the "Groups" entity, there is "Content (search_api_reverse_entity_references_group_relationship__gid:entity_id)" which seems to describe the opposite (referencing content via the group, rather than the group via the content), however with this added the field rather bizarrely outputs user memberships to the group! (is that a bug?)

💬 Support request
Status

Active

Version

3.2

Component

User interface

Created by

🇬🇧United Kingdom iancawthorne

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

Comments & Activities

Production build 0.71.5 2024