From 03f52c42d9cfa70de8a7dc33df6940e89fff021e Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Sat, 29 Oct 2011 13:46:09 +1300 Subject: [PATCH] Adds docs on Fulltext search usage in MySQL --- docs/en/topics/search.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/en/topics/search.md b/docs/en/topics/search.md index 769e195ba..1f9a15631 100644 --- a/docs/en/topics/search.md +++ b/docs/en/topics/search.md @@ -5,13 +5,25 @@ Fulltext search for page content (and other attributes like "Title" or "MetaTags") can be easily added to SilverStripe. See [Tutorial: Site Search](/tutorials/4-site-search) for details. -## Searching for DataObject's +## Searching for DataObjects The `[api:SearchContext]` class provides a good base implementation that you can hook into your own controllers. A working implementation of searchable DataObjects can be seen in the `[api:ModelAdmin]` class. [SearchContext](/reference/searchcontext) goes into more detail about setting up a default search form for `[api:DataObject]`s. +### Fulltext search on DataObjects + +The `[api:MySQLDatabase]` class now 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 + static $create_table_options = array( + 'MySQLDatabase' => 'ENGINE=MyISAM' + ); + ## Searching for Documents SilverStripe does not have a built-in method to search through file content (e.g. in PDF or DOC format).