Skip to content

Commit 69f3dca

Browse files
committed
use cards instead of cards-props
Signed-off-by: call-me-matt <nextcloud@matthiasheinisch.de>
1 parent 04a3e4b commit 69f3dca

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,10 @@ private function buildIndex($offset, $stopAt) {
9595

9696
// get contacts with social profiles
9797
$query = $this->db->getQueryBuilder();
98-
// TODO: return contacts with multiple social profiles only once
99-
// FIXME: distinct seems only to return the first parameter?
100-
// $query->selectDistinct('c.addressbookid', 'c.uri', 'c.carddata')
101-
$query->select('c.id', 'c.addressbookid', 'c.uri', 'c.carddata')
102-
->from('cards_properties', 'p')
103-
->leftJoin('p', 'cards', 'c', 'c.id = p.cardid')
104-
->where($query->expr()->eq('p.name', $query->createNamedParameter('X-SOCIALPROFILE')))
105-
->andWhere($query->expr()->lte('c.id', $query->createNamedParameter($stopAt)))
106-
->andWhere($query->expr()->gt('c.id', $query->createNamedParameter($offset)))
107-
->orderBy('c.id', 'ASC')
98+
$query->select('id', 'addressbookid', 'uri', 'carddata')
99+
->from('cards', 'c')
100+
->orderBy('id', 'ASC')
101+
->where($query->expr()->like('carddata', $query->createNamedParameter('%SOCIALPROFILE%')))
108102
->setMaxResults(100);
109103
$social_cards = $query->execute()->fetchAll();
110104

0 commit comments

Comments
 (0)