summaryrefslogtreecommitdiffstats
path: root/lib/search.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/search.php')
-rw-r--r--lib/search.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/search.php b/lib/search.php
index 37f597fd..199ce5c1 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -125,13 +125,14 @@ function search_song($data,$operator,$method,$limit) {
if (!(strpos($value, '-'))) // if we want a fuzzier search
$additional_soundex = true;
- $where_sql = " MATCH (`artist2`.`name`, `album2`.`name`, `song`.`title`) AGAINST ('$value' IN BOOLEAN MODE)";
+ $where_sql = "( MATCH (`artist2`.`name`, `album2`.`name`, `song`.`title`) AGAINST ('$value' IN BOOLEAN MODE)";
if ($additional_soundex) {
$where_sql.= " OR `artist2`.`name` SOUNDS LIKE '$value'";
$where_sql.= " OR `album2`.`name` SOUNDS LIKE '$value'";
- $where_sql.= " OR `song`.`title` SOUNDS LIKE '$value' $operator";
+ $where_sql.= " OR `song`.`title` SOUNDS LIKE '$value' ";
}
+ $where_sql .= ") $operator";
$table_sql = " LEFT JOIN `album` as `album2` ON `song`.`album`=`album2`.`id`";
$table_sql.= " LEFT JOIN `artist` AS `artist2` ON `song`.`artist`=`artist2`.`id`";