- Issue created by @fmb
- πΊπΈUnited States tedfordgif
I'm not sure there is a general solution here, but this probably belongs on the Search API project. For example, Elasticsearch supports null value replacement when indexing, notably with the same-type restriction mkalkbrenner discussed on Slack (can't index a "NULL" string for a long int field).
An alternative general approach would be to create an additional field for each nullable field in the index. E.g. for solr create is_field_number and null_field_number, the latter being a type="boolean" field added to the schema.xml. Search API would add the general support, and each backend would declare support and implement it differently depending on the type of the field. I'm not sure this actually works in practice, and it is complex.
Perhaps instead of the general/framework component, this issue should be scoped for only the Views integration? Is there another place where empty values cause extra entity loads? Maybe just spin out a separate ticket for that approach.
- π©πͺGermany mkalkbrenner π©πͺ
I think, the simplest solution would be the "kill switch". If a backend sets it, search_api should treat a missing field as NULL and don't try to load it from the entity. The result should be the same, just faster.
- First commit to issue fork.
- Merge request !161Issue #3348107: Introduce index setting, which makes it possible to disable entity loading in the preRender β (Open) created by bojan_dev
- Status changed to Needs review
3 months ago 2:40pm 19 August 2024 - π³π±Netherlands bojan_dev
Added setting/kill switch as suggested, please review.