mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Changed MySQLFulltextSearchable class to FulltextSearchable (applies to all databases)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@102012 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
09353a2b6c
commit
67c4a33e17
@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Provides a simple search engine for your site based on the MySQL FULLTEXT index
|
||||
*/
|
||||
class MySQLFulltextSearchable extends DataObjectDecorator {
|
||||
class FulltextSearchable extends DataObjectDecorator {
|
||||
protected $searchFields;
|
||||
|
||||
/**
|
||||
@ -18,9 +18,9 @@ class MySQLFulltextSearchable extends DataObjectDecorator {
|
||||
if(!is_array($searchableClasses)) $searchableClasses = array($searchableClasses);
|
||||
foreach($searchableClasses as $class) {
|
||||
if(isset($defaultColumns[$class])) {
|
||||
Object::add_extension($class, "MySQLFulltextSearchable('{$defaultColumns[$class]}')");
|
||||
Object::add_extension($class, "FulltextSearchable('{$defaultColumns[$class]}')");
|
||||
} else {
|
||||
throw new Exception("MySQLFUlltextSearchable::enable() I don't know the default search columns for class '$class'");
|
||||
throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '$class'");
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,10 @@ class SearchFormTest extends FunctionalTest {
|
||||
|
||||
protected $requiredExtensions = array(
|
||||
"SiteTree" => array(
|
||||
"MySQLFulltextSearchable('Title,MenuTitle,Content,MetaTitle,MetaDescription,MetaKeywords')",
|
||||
"FulltextSearchable('Title,MenuTitle,Content,MetaTitle,MetaDescription,MetaKeywords')",
|
||||
),
|
||||
"File" => array(
|
||||
"MySQLFulltextSearchable('Filename,Title,Content')",
|
||||
"FulltextSearchable('Filename,Title,Content')",
|
||||
),
|
||||
"ContentController" => array(
|
||||
"ContentControllerSearchExtension",
|
||||
|
@ -12,10 +12,10 @@ class TranslatableSearchFormTest extends FunctionalTest {
|
||||
protected $requiredExtensions = array(
|
||||
'SiteTree' => array(
|
||||
'Translatable',
|
||||
"MySQLFulltextSearchable('Title,MenuTitle,Content,MetaTitle,MetaDescription,MetaKeywords')",
|
||||
"FulltextSearchable('Title,MenuTitle,Content,MetaTitle,MetaDescription,MetaKeywords')",
|
||||
),
|
||||
"File" => array(
|
||||
"MySQLFulltextSearchable('Filename,Title,Content')",
|
||||
"FulltextSearchable('Filename,Title,Content')",
|
||||
),
|
||||
"ContentController" => array(
|
||||
"ContentControllerSearchExtension",
|
||||
|
Loading…
Reference in New Issue
Block a user