[IMPR] Minor search improvements

This commit is contained in:
Tony Air 2023-04-28 20:53:40 +02:00
parent 0e70a5c690
commit 8e5d69f35f

View File

@ -109,7 +109,7 @@ class PageController extends ContentController
) )
), ),
RequiredFields::create(['q']) RequiredFields::create(['q'])
)->setFormMethod('POST'); )->setFormMethod('GET');
$form->setLegend('Search ' . $config->getField('Title') . ' Website'); $form->setLegend('Search ' . $config->getField('Title') . ' Website');
@ -136,7 +136,8 @@ class PageController extends ContentController
$pages = SiteTree::get()->filterAny([ $pages = SiteTree::get()->filterAny([
'Title:PartialMatch' => $term, 'Title:PartialMatch' => $term,
'Content:PartialMatch' => $term, 'Content:PartialMatch' => $term,
'ClassName:not' => ErrorPage::class, ])->exclude([
'ClassName' => ErrorPage::class,
])->sort('Created DESC'); ])->sort('Created DESC');
$results->merge($pages); $results->merge($pages);