owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.36k stars 180 forks source link

Sync saved searches across clients #4667

Open michaelstingl opened 1 year ago

michaelstingl commented 1 year ago

Is your feature request related to a problem? Please describe.

ownCloud iOS app 12.0+ comes with a very fancy search feature:

Users can combine multiple search parameters, then save this search to access it later again.

It would be super-awesome, if users could see the same search results as a shortcut in other clients, for example in the left sidebar in ownCloud web. (https://github.com/owncloud/web/issues/7691)

Describe the solution you'd like

oCIS would need to provide a new API/endpoint, where such search queries could be saved and accessed from all clients. (per-user)

Describe alternatives you've considered

File-based approach inside the WebDAV tree: iOS app could upload a hidden JSON file in a hidden .search folder.

Additional context

See screenshots and example search queries in https://github.com/owncloud/ios-app/pull/1142

felix-schwarz commented 1 year ago

Learnings from iOS implementation

Learnings from https://github.com/owncloud/ios-app/pull/1142 that might help with this feature:

Parsing

When a user enters a search term, it is processed in several steps. By example, based on :today cupola (search files with "cupola" in the name, last modified today):

Usage of Search Elements

The Search Elements coming from Parsing allow usage in different contexts:

Persistance

Saved searches are stored in records with the following fields:

The searchTerm is stored as a simple string because that makes it portable and ensures that :today always means the current day, not the day the search was saved (as would happen when saving the Search Elements, as :today is parsed into f.ex. lastModified >= "2022-09-27 00:00:00", lastModified < "2022-09-28 00:00:00"`).

Search templates and search views

Search expressions

A list of supported search expressions by the iOS app is part of https://github.com/owncloud/ios-app/pull/1142.

API proposal

An API could offer four endpoints:

Ideas

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.