Active
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2017 at 16:02 UTC
Updated:
29 Jan 2020 at 13:36 UTC
Jump to comment: Most recent
Posting this as a potential use case for #2851851: Facet source plugins should provide metadata for facet fields. Hence immediately postponing it on that.
With #2625152: Implement a Hierarchical Entity Processor and #2807333: Implement hierarchical structures in facets it becomes possible to store, and use hierarchy of fields to use in a facet. To work with fields across entity types, you need to combine the values into an aggregated field. The field has no metadata about type. So the hierarchy display is not available, even if you only combined say Taxonomy Term entities. Similarly for display this is not available for turning the ID into a translatabled entity name.
Comments
Comment #2
ekes commentedFor those looking for a work around now:
Create an aggregated facet (first or union) that includes the Taxonomy Term field from the entity types.
Create a search_api processor that inherits the addHierarchy processor, but add you fields manually.
Then to translate the ID to display I couldn't think of anything better than a cut & paste of facets TranslateEntityProcessor hard coding the entity type (Taxonomy term) that you put into the aggregated field.
Obviously this is going to fail if there are more than one entity type aggregated - but I can't think of a use case where that makes sense for hierarchy.
Comment #3
borisson_Making this active, because the original issue is now in. We're also adding our first test regarding aggregation as well in #2917323: Critical error thrown when editing a facet based on an aggregated field. But this can be worked on - if someone feels like a fun evening.
Comment #4
tsymi commentedThanks a lot ! AddHierarchy processor gave on #2 works for me.