mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 15:05:45 +00:00
BUGFIX: search requests via ts_query now accept some boolean-formatted requests
This commit is contained in:
parent
7ee6640051
commit
8032985b1a
@ -1357,6 +1357,13 @@ class PostgreSQLDatabase extends SS_Database {
|
||||
*/
|
||||
public function searchEngine($classesToSearch, $keywords, $start, $pageLength, $sortBy = "ts_rank DESC", $extraFilter = "", $booleanSearch = false, $alternativeFileFilter = "", $invertedMatch = false) {
|
||||
|
||||
//Fix the keywords to be ts_query compatitble:
|
||||
//Spaces must have pipes
|
||||
//@TODO: properly handle boolean operators here.
|
||||
$keywords=trim($keywords);
|
||||
$keywords=str_replace(' ', ' | ', $keywords);
|
||||
$keywords=str_replace('"', "'", $keywords);
|
||||
|
||||
$keywords = Convert::raw2sql(trim($keywords));
|
||||
$htmlEntityKeywords = htmlentities($keywords);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user