Uh oh!
There was an error while loading. Please reload this page.
Use paginated search for contacts - #18816
Conversation
6f5ba0d to
c41a99bCompareUh oh!
There was an error while loading. Please reload this page.
c41a99b to
043c013Compare| // 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
nickvergessen
commented
Apr 15, 2020
Needs a rebase |
043c013 to
8fd2031CompareMorrisJobke
commented
Apr 17, 2020
Done. |
blizzz
commented
Apr 17, 2020
CI looks quite red |
8fd2031 to
17104b5CompareSigned-off-by: Julius Härtl <jus@bitgrid.net>
17104b5 to
6709833Comparejuliusknorr
commented
Apr 23, 2020
Aw, isset is no function so using |
nickvergessen
commented
Apr 29, 2020
:( |
J0WI
commented
Apr 29, 2020
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 ?)
LIMIT10
);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 ?)
LIMIT10
)
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)