Load entity only if user selects - Use entity render in view field or create new view field level settings

Created on 30 March 2022, almost 3 years ago
Updated 26 March 2023, almost 2 years ago

Problem/Motivation

It is very costly to load the entity for search result page. However when an entity gets indexed and a particular field is not filled with data the index does not contain an empty array but it contains simply nothing. This leads to search api doing a full load of the entity because it can not detect the dependency as loaded - see:
/search_api/src/Plugin/views/field/SearchApiFieldTrait.php ~around Line 567

foreach ($dependents as $dependent) {
if (!isset($row->$dependent)) {
$required = TRUE;
...

Steps to reproduce

Index some fields of an entity, fill the fields on some entities and on some not, index that and display that in a view.

Proposed resolution

Either we must store an empty array for an indexed value that was empty or we need to check for empty fields otherwise.

Remaining tasks

Feature request
Status

Postponed: needs info

Version

1.0

Component

Views integration

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024