Merge pull request #77 from MrPetovan/bug/76-remove-at-sign-fulltext-search
Remove at sign (@) from fulltext query string
This commit is contained in:
commit
750e369f57
|
@ -48,6 +48,8 @@ class MatchSearch
|
||||||
$pager->setPage(filter_input(INPUT_POST, 'p', FILTER_SANITIZE_NUMBER_INT));
|
$pager->setPage(filter_input(INPUT_POST, 'p', FILTER_SANITIZE_NUMBER_INT));
|
||||||
|
|
||||||
$sql_where = "MATCH (p.`tags`) AGAINST (:query)";
|
$sql_where = "MATCH (p.`tags`) AGAINST (:query)";
|
||||||
|
// At sign (@) is a reserved symbol in InnoDB full-text search, it can't be escaped
|
||||||
|
$query = str_replace('@', ' ', $query);
|
||||||
|
|
||||||
$values = ['query' => $query];
|
$values = ['query' => $query];
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,8 @@ class Search
|
||||||
} else {
|
} else {
|
||||||
$sql_where = "MATCH (p.`name`, p.`pdesc`, p.`username`, 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)";
|
AGAINST (:query IN BOOLEAN MODE)";
|
||||||
|
// At sign (@) is a reserved symbol in InnoDB full-text search, it can't be escaped
|
||||||
|
$query = str_replace('@', ' ', $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = ['query' => $query];
|
$values = ['query' => $query];
|
||||||
|
|
|
@ -73,6 +73,8 @@ class Search extends BaseController
|
||||||
} else {
|
} else {
|
||||||
$sql_where = "MATCH (p.`name`, p.`pdesc`, p.`username`, 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)";
|
AGAINST (:query IN BOOLEAN MODE)";
|
||||||
|
// At sign (@) is a reserved symbol in InnoDB full-text search, it can't be escaped
|
||||||
|
$query = str_replace('@', ' ', $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = ['query' => $query];
|
$values = ['query' => $query];
|
||||||
|
|
Loading…
Reference in a new issue