Closed (works as designed)
Project:
Entity reference
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jun 2012 at 03:39 UTC
Updated:
27 Jun 2012 at 17:59 UTC
Hello,
Search API requires hook_entity_property_info , so fields in referenced nodes can be properly indexed together with the referrring node fields (some issues:
#1118282: Node reference integration and http://drupal.org/project/issues/search_api?text=hook_entity_property_in... ).
I grepped the current entityreference code but have not found hook_entity_property_info .
Comments
Comment #0.0
giorgio79 commenteddfgdf
Comment #1
damien tournoud commentedWe are properly integrated with the Entity Metadata API (see
entityreference_field_property_callback()referenced intoentityreference_field_info()), and this integration is definitely working.Any specific feature request here?
Comment #2
giorgio79 commentedThanks Damien.
In short: In a search view, currently it is not possible to use facetapi blocks for fields in referenced nodes for some reason, and I have yet to find a solution.
High level example with 2 content types:
1 content type: school (with address field for example)
1 content type: teacher, with entity reference for school
It would be great to filter teachers based on fields in school, but facet blocks for school fields do not show for a search view if it includes only teachers. (even if searvc view has a relationship defined for school).
For example if school has an address field, it would be great to use school's address field facets for teachers, as if they would belong to the teacher entity.
Also tried to discuss this with cpliakas but he says this has to do with the way search api indexes entities: #1626478: Ability to use facet for a referenced entity?
Comment #3
damien tournoud commentedThat should work out of the box. I assume you are indexing teachers, and that's what you want to display. Then you need to add the fields of the school you want to filter / facet by in the index (*not* in the view). You will find them by adding the proper relation at the bottom of the "Field" tab of the index.
Comment #4
giorgio79 commentedYep, tried a couple of times. I even have the facet available.
Will try to create a new index to test.
Comment #5
giorgio79 commentedI managed to narrow the issue down a bit, and I believe it is a Search API issue:
#1661514: Hierarchical taxonomy unavailable through referenced entity
Essentially, hierarchical taxonomies do not seem to be available for referenced entities in Search API.
Comment #6
damien tournoud commentedOk, I'm going to assume the issue is somewhere else.
Comment #7
giorgio79 commentedYep, thanks. I was just about to close it. :) Looks like it is somewhere in search api or search api db.
Comment #7.0
giorgio79 commentedioiopiop