Scenario (simplified)
- A content type with a number of fields.
- One of the fields is (optional) single-value entity reference revision, pointing to a custom entity type with more fields. There are 3-4 fields (the 4th only occurs in one bundle).
- One of the fields is an entity reference, pointing to a taxonomy term.
- A search index for the main content type.
- Search server uses search_api_solr.
- Some of the fields from the content type are indexed, others are not.
- Some of the fields of the referenced entity are indexed, others are not.
- A search view using the search index, with row plugin "Fields".
- The fields are needed for a table display.
(Actually this is a lie. We use "Data export (csv)". But I am not even sure why we combine this with search api. So for the sake of this question let's pretend it is a table.)
- We want to display all fields from the content type and all fields from the referenced entity as table columns, including fields that are not indexed.
It does not really make sense to index fields that we use for display, but not for searching and filtering. Drupal should load these values directly from the entity instead. It already loads the entities anyway.
Observation
- For the main content type, all the fields are available. For indexed fields, there is an additional entry with label like
"@name (indexed fields)"
. All of them have category "Content datasource".
- In relationships, I see nothing about the entity reference revision field, but I do see something about the term reference.
- For the custom entity type referenced with entity reference revision, only those fields are available in views that are indexed. All of them have a label like
"@name (indexed field)"
.
- For the referenced term, fields become available after adding the relationship.
Question
How can we display fields from the referenced entity as table columns, without adding them to the index?
Why do different instances of a field have category "Content datasource", even though one is from the indexed field, and the other is from the entity field?
Notes
Yes, I could simply add the fields to the index. But it feels wrong, and adds overhead in the indexing process.
I really