Conversation
6f5ba0d to
c41a99b
Compare
c41a99b to
043c013
Compare
| // Search in contacts | ||
| //@todo Pagination missing | ||
| $addressBookContacts = $this->contactsManager->search($search, ['CLOUD', 'FN']); | ||
| $addressBookContacts = $this->contactsManager->search($search, ['CLOUD', 'FN'], ['limit' => $limit, 'offset' => $offset]); |
There was a problem hiding this comment.
The problem is, if you e.g. match the local domain, you will get all system address book entries.
But they are skipped with the first if in the loop, but also no further contacts will be found, although you would have matches.
There was a problem hiding this comment.
Contacts from other addressbooks should still be found, since the search is executed with the limit on each addressbook individually: https://github.com/nextcloud/server/pull/18816/files#diff-905974f5907f69fe7586a80ea67117a6L48
|
Needs a rebase |
043c013 to
8fd2031
Compare
Done. |
|
CI looks quite red |
8fd2031 to
17104b5
Compare
Signed-off-by: Julius Härtl <jus@bitgrid.net>
17104b5 to
6709833
Compare
|
Aw, isset is no function so using |
:( |
current syntaxSELECT `c`.`carddata`, `c`.`uri`
FROM `oc_cards` `c`
WHERE `c`.`id` IN (
SELECT DISTINCT `cp`.`cardid`
FROM `oc_cards_properties` `cp`
WHERE (`cp`.`addressbookid` = ?)
AND ((`cp`.`name` = ?)
OR (`cp`.`name` = ?))
AND (`cp`.`value` COLLATE utf8mb4_general_ci LIKE ?)
LIMIT 10
);SELECT `c`.`carddata`, `c`.`uri`
FROM `oc_cards` `c`
WHERE `c`.`id` IN (
SELECT `cardid` FROM (
SELECT DISTINCT `cp`.`cardid`
FROM `oc_cards_properties` `cp`
WHERE (`cp`.`addressbookid` = ?)
AND ((`cp`.`name` = ?)
OR (`cp`.`name` = ?))
AND (`cp`.`value` COLLATE utf8mb4_general_ci LIKE ?)
LIMIT 10
)
AS compatlayer
); |
This PR drastically improves the performance of searching for sharees when the system addressbook contains a lot of users. Without it all matching contact entries would be queried from the database for both SHARE_TYPE_REMOTE and SHARE_TYPE_EMAIL which led to quite bad performance when searching with queries that matched a lot of entries (1-3 characters)