summaryrefslogtreecommitdiffstats
path: root/lib/search.php
diff options
context:
space:
mode:
authorPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-03-20 08:02:11 +0000
committerPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-03-20 08:02:11 +0000
commit81b874d4066e69dd246a01044e911a15fa10e335 (patch)
tree8cf022411f3b8e214f2664e455880989cb7c8f8b /lib/search.php
parent9258b7d2a98cbb2e49769a3d30c82b222fb059ec (diff)
downloadampache-81b874d4066e69dd246a01044e911a15fa10e335.tar.gz
ampache-81b874d4066e69dd246a01044e911a15fa10e335.tar.bz2
ampache-81b874d4066e69dd246a01044e911a15fa10e335.zip
Make keyword search *really* play nice with others, by interacting with
the designated operator as expected.
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`";