Is it possible to remove pages that should not be shown (defined by the Embargo/Expiry module) from the site search results? I tried the following, but I am still getting pages that should not be shown:
function results($data, $form)
{
$results = $form->getResults();
foreach ($results as $result)
{
if ($result->Embargo != NULL && $result->Embargo < strftime('now'))
{
$results->remove($result);
}
if ($result->Expiry != NULL && $result->Expiry >= strftime('now'))
{
$results->remove($result);
}
}
$data = array(
'Results' => $results,
'Query' => $form->getSearchQuery(),
'Title' => 'Search Results'
);
return $this->customise($data)->renderWith(array('Page_results', 'Page'));
}