[DATABASE] Enable fulltext search by default

Also rename fulltext indices to more fitting names

Imported from v2/f84dbb369f01a1d4a9bc362d01cdd100cdc79313
This commit is contained in:
Alexei Sorokin 2020-08-09 12:58:55 +00:00 committed by Hugo Sales
parent 4128a5403d
commit eb12ac5ef1
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 5 additions and 9 deletions

View File

@ -212,7 +212,7 @@ abstract class DefaultSettings
'allow_tagging' => ['local' => true, 'remote' => true],
'description_limit' => null,
],
'search' => ['type' => 'like'],
'search' => ['type' => 'fulltext'],
'html_filter' => ['tags' => ['img', 'video', 'audio', 'script']],
'notice' => [
'content_limit' => null,

View File

@ -267,12 +267,9 @@ class Activity
'activity_profile_id_verb_idx' => ['profile_id', 'verb'],
'activity_replyto_idx' => ['reply_to'],
],
'fulltext indexes' => ['notice_fulltext_idx' => ['content']]
];
if (isset($_ENV['SOCIAL_DB_USE_FULLTEXT_SEARCH'])) {
$def['fulltext indexes'] = ['content' => ['content']];
}
return $def;
}
}

View File

@ -261,12 +261,11 @@ class Profile extends Entity
'indexes' => [
'profile_nickname_idx' => ['nickname'],
],
'fulltext indexes' => [
'profile_fulltext_idx' => ['nickname', 'fullname', 'location', 'bio', 'homepage']
],
];
if (isset($_ENV['SOCIAL_DB_USE_FULLTEXT_SEARCH'])) {
$def['fulltext indexes'] = ['nickname' => ['nickname', 'fullname', 'location', 'bio', 'homepage']];
}
return $def;
}
}