Merge pull request #62 from MrPetovan/task/39-search-match-username

Add missing column in profile fulltext index
This commit is contained in:
Tobias Diekershoff 2020-09-27 14:46:56 +02:00 committed by GitHub
commit 360c421796
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 3 deletions

View file

@ -47,7 +47,7 @@ class Search
$query .= '%';
$sql_where = '`' . $field . '` LIKE :query';
} else {
$sql_where = "MATCH (p.`name`, p.`pdesc`, p.`profile_url`, p.`locality`, p.`region`, p.`country`, p.`tags` )
$sql_where = "MATCH (p.`name`, p.`pdesc`, p.`username`, p.`locality`, p.`region`, p.`country`, p.`tags` )
AGAINST (:query IN BOOLEAN MODE)";
}

View file

@ -0,0 +1,2 @@
BEGIN;
COMMIT;

View file

@ -0,0 +1,2 @@
BEGIN;
COMMIT;

View file

@ -1,4 +1,4 @@
BEGIN;
ALTER TABLE `profile` DROP KEY `profile-ft`;
ALTER TABLE `profile` ADD FULLTEXT KEY `profile-ft` (`name`, `pdesc`, `profile_url`, `locality`, `region`, `country`);
ALTER TABLE `profile` ADD FULLTEXT KEY `profile-ft` (`name`, `pdesc`, `profile_url`, `locality`, `region`, `country`, `tags`);
COMMIT;

View file

@ -1,4 +1,4 @@
BEGIN;
ALTER TABLE `profile` DROP KEY `profile-ft`;
ALTER TABLE `profile` ADD FULLTEXT KEY `profile-ft` (`name`, `pdesc`, `username`, `locality`, `region`, `country`);
ALTER TABLE `profile` ADD FULLTEXT KEY `profile-ft` (`name`, `pdesc`, `username`, `locality`, `region`, `country`, `tags`);
COMMIT;