While configuring facets for a term reference I ran into the issue that I mistakenly configured the index to use the referenced terms "tid" property. Index the whole field item was not my intuitive choice, so I avoid that. However, together with the facets module this seems to be required right now.

Instead, I think it would be best if once could index the property implementing the DataReferenceInterface. That way you can easily check it references to entities (get the target definition and check it implements EntityDataDefinitionInterface).

This would make the configuration more intuitive and allow the facets module to provide things like entity-label processor without making any assumptions about the data structure indexed. Right now it assume it's an entity reference field item having an "entity" property, what works but won't work for other data structures that have differently structured entity references.

Related: #2844637: Entity id to label processor fatals if configured with the wrong property

Comments

fago created an issue.

fago’s picture

drunken monkey’s picture

Could you add a screenshot explaining what you mean? Which property would you like to index?
Facet API making wrong assumptions about data structures doesn't seem to be our problem. In this module, I think we always try to make things work without any such hard-coded assumptions.