Hi, I'm trying to follow this tutorial to implement Fulltext Search on a DataObject.
https://docs.silverstripe.org/en/3.1/developer_guides/search/fulltextsearch/
My Object looks the followin:
class Item extends DataObject {
private static $db = array(
"Title" => "Varchar(255)",
"Teaser" => "Text",
"Content" => "Text"
);
private static $indexes = array(
'SearchFields' => array(
'type' => 'fulltext',
'name' => 'SearchFields',
'value' => '"Title", "Teaser", "Content"',
)
);
}
I'm trying to return a List of Objects using the folowing Filter/Variants, but neither of them is working.
Item::get()->filter(array("SearchFields:Fulltext" => $query));
Item::get()->filter(array("Title,Teaser,Content:Fulltext" => $query));
Item::get()->filter(array("'Title','Teaser','Content':Fulltext" => $query));
The MySQL Error I get returned is the follwoing:
Couldn't run query: SELECT DISTINCT count(DISTINCT "Item"."ID") AS "0" FROM "Item" WHERE (MATCH (""."SearchFields") AGAINST ('centro')) Unknown column 'SearchFields' in 'where clause'
[User Error] Couldn't run query: SELECT DISTINCT count(DISTINCT "Item"."ID") AS "0" FROM "Item" WHERE (MATCH (""."Title,Teaser,Content") AGAINST ('centro')) Unknown column 'Title,Teaser,Content' in 'where clause'
[User Error] Couldn't run query: SELECT DISTINCT count(DISTINCT "Item"."ID") AS "0" FROM "Item" WHERE (MATCH (""."'Title','Teaser','Content'") AGAINST ('centro')) Unknown column ''Title','Teaser','Content'' in 'where clause'
am I missing anything? I did not converted my TAbles to MyISAM, because I'm using MySQL 5.6 which is also supporting fulltext search on InnoDB, so that shouldn't be the point. But What I really do not understand (tried allready to dive into FulltextFilter) is why the filtered tables are taken as a Table.Column (""."SearchFields") notation and where the hack can I change this.
I'm running Silverstripe 3.1.13 currently.