contacts icon indicating copy to clipboard operation
contacts copied to clipboard

Advanced search strings

Open spoorun opened this issue 7 years ago • 7 comments

Users with many contacts (and there are many such Users) would benefit from an advanced search feature.

Zimbra enables users to search by field: Example: #homecountry:Canada Finds all contacts who reside in Canada

And can search mutiple values: Example: NOT #homecity:Vancouver Canada Finds all contacts who have the word Canada mentioned, but don't live in Vancouver


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

spoorun avatar Aug 30 '17 10:08 spoorun

Nice idea! How should we use the property search string?

I don't like the hash in search, maybe just use like fn:test kind of string?

skjnldsv avatar Aug 30 '17 13:08 skjnldsv

Would be easier to implement with unified search filters for 20 :)

@georgehrke, I'm not convinced havingthe search providers in server was the good call :thinking: What do you think? I feel I'm tight to the server version now :/

skjnldsv avatar Sep 06 '20 15:09 skjnldsv

Well, the problem here is that either way is not perfect. Implementing the search provider in the server requires the server to have knowledge of the routing of the Contacts app. However, implementing the Search provider in Contacts requires you to use private Classes of the dav app. These classes might change at any time, maybe even in a backport of a bugfix.

So the first one is definitely the lesser of two evils.

georgehrke avatar Sep 06 '20 17:09 georgehrke

Well, the problem here is that either way is not perfect. Implementing the search provider in the server requires the server to have knowledge of the routing of the Contacts app. However, implementing the Search provider in Contacts requires you to use private Classes of the dav app. These classes might change at any time, maybe even in a backport of a bugfix.

So the first one is definitely the lesser of two evils.

I could also just use the contacts manager classes from OCP ?

skjnldsv avatar Sep 07 '20 06:09 skjnldsv

I could also just use the contacts manager classes from OCP ?

Only with modifications to the OCP\Contacts classes. When implementing the search provider, I extended the Backend to allow searching all address-books of a user at once. https://github.com/nextcloud/server/pull/22011/files#diff-cec75d1f60809c8d36dd837cfdc60531R996

The pagination capabilities of OCP are very limited. At the moment, it just applies the limit/offset to each addressbook and returns all results: https://github.com/nextcloud/server/blob/master/lib/private/ContactsManager.php#L48L62

georgehrke avatar Sep 07 '20 06:09 georgehrke

The pagination capabilities of OCP are very limited. At the moment, it just applies the limit/offset to each addressbook and returns all results:

So, what do you think we should do? Leave it as is?

skjnldsv avatar Sep 07 '20 10:09 skjnldsv

I would just leave it as is. The only real downside is that you are stuck to the server release schedule, when it comes to adding new search features. But since there is a new server major every 4 to 5 months, i would say that's acceptable.

georgehrke avatar Sep 07 '20 11:09 georgehrke