Enabling Search Indexability

Any time a user uses the Concrete5 search block or the Dashboard Page Search to search pages, that query uses the PageSearchIndex database table. This table is also queried every time a developer uses \Concrete\Core\Page\PageList::filterByKeywords. It's easy to enable your block's to add their content to the page search index; simply add a method named getSearchableContent() to your block's controller file. For example, here's how the Feature block implements this method:

public function getSearchableContent()
{
    return $this->title . ' ' . $this->paragraph;
}
Loading Conversation