/**
* Sets the search page as the default.
*
* @param \Drupal\search\SearchPageInterface $search_page
* The search page entity.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* A redirect to the search settings page.
*/
public function setAsDefault(SearchPageInterface
$search_page) { // Set the default page to this search page.
$this->searchPageRepository->
setDefaultSearchPage($search_page);
$this->
messenger()->
addStatus($this->
t('The default search page is now %label. Be sure to check the ordering of your search pages.',
['%label' =>
$search_page->
label()]));
return $this->
redirect('entity.search_page.collection'
);
}}