public static function schemaDef()
{
- return array(
+ $def = array(
'fields' => array(
'id' => array('type' => 'serial', 'not null' => true, 'description' => 'unique identifier'),
'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'who made the update'),
'notice_repeatof_idx' => array('repeat_of'),
)
);
+
+ if (common_config('search', 'type') == 'fulltext') {
+ $def['fulltext indexes'] = array('content' => array('content'));
+ }
+
+ return $def;
}
function multiGet($kc, $kvs, $skipNulls=true)
public static function schemaDef()
{
- return array(
+ $def = array(
'description' => 'local and remote users have profiles',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => true, 'description' => 'unique identifier'),
'profile_nickname_idx' => array('nickname'),
)
);
+
+ // Add a fulltext index
+
+ if (common_config('search', 'type') == 'fulltext') {
+ $def['fulltext indexes'] = array('nickname' => array('nickname', 'fullname', 'location', 'bio', 'homepage'));
+ }
+
+ return $def;
}
function multiGet($keyCol, $keyVals, $skipNulls=true)
$this->appendCreateIndex($statements, $tableName, $indexName, $def['indexes'][$indexName]);
}
+ foreach ($fulltext['mod'] + $fulltext['add'] as $indexName) {
+ $colDef = $def['fulltext indexes'][$indexName];
+ $this->appendCreateFulltextIndex($statements, $tableName, $indexName, $colDef);
+ }
+
return $statements;
}