diff --git a/app/Http/Controllers/NewCatalogController.php b/app/Http/Controllers/NewCatalogController.php index 333890819..a769b7418 100644 --- a/app/Http/Controllers/NewCatalogController.php +++ b/app/Http/Controllers/NewCatalogController.php @@ -15,14 +15,6 @@ class NewCatalogController extends Controller */ public function index() { - $yearLimits = Cache::remember( - 'items.year-limits', - now()->addHours(1), - fn() => Item::getYearLimits() - ); - - return view('frontend.catalog-new.index-new', [ - 'yearLimits' => $yearLimits, - ]); + return view('frontend.catalog-new.index-new'); } } diff --git a/app/Item.php b/app/Item.php index 89d548dcc..abd9467f9 100644 --- a/app/Item.php +++ b/app/Item.php @@ -144,31 +144,6 @@ public function getCitation() return $this->getTitleWithAuthors() . ', ' . $this->getDatingFormated() . ', ' . $this->gallery . ', ' . $this->getUrl(); } - // Get limits from elastic, because date_earliest and date_latest - // are not indexed in DB - public static function getYearLimits() - { - $searchResult = self::searchQuery(Query::matchAll()) - ->size(false) - ->aggregate('min', [ - 'min' => [ - 'field' => 'date_earliest', - ], - ]) - ->aggregate('max', [ - 'max' => [ - 'field' => 'date_latest', - ], - ]) - ->execute() - ->raw(); - - return [ - 'min' => $searchResult['aggregations']['min']['value'], - 'max' => $searchResult['aggregations']['max']['value'], - ]; - } - public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addGetterConstraint('images', new Valid()); }