diff --git a/lib/private/contactsmanager.php b/lib/private/contactsmanager.php
index 1cb3da7098f89fa3916f97b6f776204b0c7be6fa..4299d88017a7fa462cd137f3b2fe01681e9befaf 100644
--- a/lib/private/contactsmanager.php
+++ b/lib/private/contactsmanager.php
@@ -37,7 +37,12 @@ namespace OC {
 			$result = array();
 			foreach($this->address_books as $address_book) {
 				$r = $address_book->search($pattern, $searchProperties, $options);
-				$result = array_merge($result, $r);
+				$contacts = array();
+				foreach($r as $c){
+					$c['addressbook-key'] = $address_book->getKey();
+					$contacts[] = $c;
+				}
+				$result = array_merge($result, $contacts);
 			}
 
 			return $result;