summaryrefslogtreecommitdiffstats
path: root/lib/search.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-26 10:37:26 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-26 10:37:26 +0000
commit9e73de9555b4f1873a9a08fdb6c23a2db6ad25da (patch)
tree9dfd770158eb96feef0af868c3dea2f42f1392cc /lib/search.php
parent31434f5abfb9dbb7c082208274142a065266dcf8 (diff)
downloadampache-9e73de9555b4f1873a9a08fdb6c23a2db6ad25da.tar.gz
ampache-9e73de9555b4f1873a9a08fdb6c23a2db6ad25da.tar.bz2
ampache-9e73de9555b4f1873a9a08fdb6c23a2db6ad25da.zip
made the keyword search also look at tag information
Diffstat (limited to 'lib/search.php')
-rw-r--r--lib/search.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/search.php b/lib/search.php
index 9f0770da..fe01ad0d 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -130,12 +130,15 @@ function search_song($data,$operator,$method,$limit) {
album2.name LIKE '%$word%' OR
artist2.name LIKE '%$word%' OR
song.year LIKE '%$word%' OR
- song.file LIKE '%$word%'
+ song.file LIKE '%$word%' OR
+ tag2.name LIKE '%$word%'
) ";
}
$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`";
+ $table_sql .= " LEFT JOIN `artist` AS `artist2` ON `song`.`artist`=`artist2`.`id`";
+ $table_sql .= " LEFT JOIN `tag_map` ON `song`.`id`=`tag_map`.`object_id` AND `tag_map`.`object_type`='song'";
+ $table_sql .= " LEFT JOIN `tag` AS `tag2` ON `tag_map`.`tag_id`=`tag2`.`id`";
break;
case 'title':
$where_sql .= " song.title $value_string $operator";