Hi,
Thanks for your answer!
Checking my RainlabPagesResultsProvider.php provider class I have observed the search method code base differs from your GitHub code.
In fact my search method looks like the following:
public function search()
{
if ( ! $this->isInstalledAndEnabled()) {
return $this;
}
foreach ($this->pages() as $page) {
// Make this result more relevant, if the query is found in the title
$title = $page->viewBag['meta_title'] ?? $page->viewBag['title'] ?? '';
$relevance = $this->containsQuery($title) ? 2 : 1;
$result = new Result($this->query, $relevance);
$result->title = $title;
$result->text = $page->parsedMarkup;
$result->url = $this->getUrl($page);
$result->model = $page;
$this->addResult($result);
}
return $this;
}
I tested your code and everything works well, I can see excerpts.
But probably at the next plugin update the code will change.
The SiteSearch plugin version I have installed is 1.5.6.
How should I proceed in this case? What's your advise?
Best regards,
Simon