1.7 KiB
title: Fulltext Search summary: Fulltext search allows sophisticated searching on text content.
FulltextSearchable
Fulltext search allows advanced search criteria for searching words within a text based data column. While basic Fulltext search can be achieved using the built-in [api:MySQLDatabase] class a more powerful wrapper for Fulltext search is provided through a module.
Adding Fulltext Support to MySQLDatabase
The [api:MySQLDatabase] class defaults to creating tables using the InnoDB storage engine. As Fulltext search in MySQL requires the MyISAM storage engine, any DataObject you wish to use with Fulltext search must be changed to use MyISAM storage engine.
You can do so by adding this static variable to your class definition:
:::php
<?php
class MyDataObject extends DataObject {
private static $create_table_options = array(
'MySQLDatabase' => 'ENGINE=MyISAM'
);
}
The [api:FulltextSearchable] extension will add the correct Fulltext
indexes to the data model.
API Documentation
- [api:FulltextSearchable]