Hi,
I'm using SilverStripe 3.0 in my devel site http://www.rimantoro.com/jakpus2012
Have problem with SearchForm. The search result have an error on Query, it's told "......Can't find FULLTEXT index matching the column list". I have search on API Doc for 3.0 and have no SearchForm documentation.
I have set MyISAM & FulltextSearchable::enable(); in mysite config, below
<?php
global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = array(
"type" => 'MySQLDatabase',
"server" => 'localhost',
"username" => 'xxx',
"password" => 'xxx',
"database" => 'xxx',
"path" => '',
);
MySQLDatabase::set_connection_charset('utf8');
// Set the current theme. More themes can be downloaded from
// http://www.silverstripe.org/themes/
SSViewer::set_theme('jakpus');
// Set the site locale
i18n::set_locale('en_US');
// Enable nested URLs for this site (e.g. page/sub-page/)
if (class_exists('SiteTree')) SiteTree::enable_nested_urls();
Director::set_environment_type("dev");
DataObject::$create_table_options['MySQLDatabase'] = 'ENGINE=MyISAM';
FulltextSearchable::enable();
And here is the Page.php :
<?php
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
}
class Page_Controller extends ContentController {
/**
* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
*
* <code>
* array (
* 'action', // anyone can access this action
* 'action' => true, // same as above
* 'action' => 'ADMIN', // you must have ADMIN permissions to access this action
* 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
* );
* </code>
*
* @var array
*/
public static $allowed_actions = array (
);
public function init() {
parent::init();
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
// Requirements::themedCSS('reset');
Requirements::themedCSS('layout');
// Requirements::themedCSS('typography');
// Requirements::themedCSS('form');
Requirements::themedCSS('thirdparty');
}
function searchform() {
$fields = new FieldList(
new TextField("Search", false)
);
$actions = new FieldList(
new FormAction('results', 'search')
);
return new searchform(
$this,
"searchform",
$fields,
$actions
);
}
function results($data, $form) {
$results = $form->getResults(null, $data);
$searchQueryTitle = $form->getSearchQuery($data);
$templateData = array(
'Results' => $results,
'SearchQueryTitle' => $searchQueryTitle,
'Title' => 'Search Results'
);
return $this->customise($templateData)->renderWith(array('Page_results', 'Page'));
}
}
Did I'have something wrong ?
Thanks.