From d50afd6de5bfb5c794b99c100f3d311fc9f95d8b Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 21 Apr 2008 17:02:39 +0000 Subject: Improving the metadata search in cases where users have multiple tags with the same text git-svn-id: https://code.elgg.org/elgg/trunk@508 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/metadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/lib/metadata.php') diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 5ed435a0c..aba7e782d 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -340,7 +340,7 @@ if ($meta_value!="") $where[] = "m.value_id='$meta_v'"; - $query = "SELECT * from {$CONFIG->dbprefix}entities e JOIN {$CONFIG->dbprefix}metadata m on e.guid = m.entity_guid where"; + $query = "SELECT distinct e.* from {$CONFIG->dbprefix}entities e JOIN {$CONFIG->dbprefix}metadata m on e.guid = m.entity_guid where"; foreach ($where as $w) $query .= " $w and "; $query .= " (e.access_id in {$access} or (e.access_id = 0 and e.owner_guid = {$_SESSION['id']}))"; // Add access controls -- cgit v1.2.3