diff --git a/modules/helfi_address_search/src/Plugin/views/filter/AddressSearch.php b/modules/helfi_address_search/src/Plugin/views/filter/AddressSearch.php index 4fb9a1a..eac1d0b 100644 --- a/modules/helfi_address_search/src/Plugin/views/filter/AddressSearch.php +++ b/modules/helfi_address_search/src/Plugin/views/filter/AddressSearch.php @@ -90,6 +90,10 @@ public static function sortByAddress(ViewExecutable $view): ViewExecutable { (float) $result->_entity->get('latitude')->getString(), (float) $result->_entity->get('longitude')->getString()); + // The entity should not be cached since it relies on high-cardinality + // user input. + $result->_entity->mergeCacheMaxAge(0); + // Set the distance to computed field. $result->_entity->set('distance', $distances[$result->_entity->get('id')->getString()]); }