You need to create a custom function in your DataObject to generate a string, and configure FTSearch to use that string.
Axllent\FTSearch\SearchEngine:
data_objects:
StaffPage:
- Title
- Content
- getFTSearchData
A function may be something like:
public function getFTSearchData()
{
$content = [];
foreach ($this->StaffMembers() as $staff_member) {
array_push($content, $staff_member->Title . ' ' . $staff_member->Profile);
}
return implode(' ', $content);
}
Any custom onbeforeWrite
, onAfterWrite
, onBeforeDelete
, onBeforePublish
, onBeforeUnpublish
functions
you have created in your DataObject must extend themselves (eg: $this->extend('onbeforeWrite')
). eg:
public function onBeforeWrite()
{
parent::onBeforeWrite();
// your custom functionality here
$this->extend('onBeforeWrite');
}