-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add search support on the REPORT method #25373
Comments
Additionally we should add pagination on the REPORT method that can be used regardless of the search. Ref: #13915 |
Taken from a draft spec which was planned for 9.1: RequirementsAny client using ownCloud APIs wants to search in files based on meta information as well as content. Clients are our mobile clients as well as the web ui – even the desktop client can gain some benefits from it (hint: pagination). Since everything which is related to files is handled via WebDAV – search will be just the same. There is even a search specification on its own: https://tools.ietf.org/html/rfc5323
Feature descriptionWe should follow the calendar and addressbook query approach. The WebDAV search spec introduces a completely new verb – this will pretty sure result in deployment issues. Furthermore the search spec is supported by not one single webdav client. Use-casesGallery wants to search in a sub folder Pictures for all jpeg and a special camera model as set in the exif information Next Steps
|
setting this to 9.2 - we need this for paginated file list in files. |
@georgehrke you already did come up with an proposal for the report object - please add here - THX |
@georgehrke feel free to submit a wip-pr to see how the implementation can look like - THX |
Make it a separate report called "search-files" ? Because if we mix it together with the existing "filter-files" report, it will become messy, especially if we want to combine "search by X but also filter by favorites", etc |
In addition let's try the json way .... see https://youtu.be/sqgvjidj7iQ |
@PVince81 are we ready with this? |
Search query:
Properties are PROPFIND-properties. Response is PROPFIND response with a list of result nodes. |
We could use the Depth header or have
To do a pagination PROPFIND without search: use REPORT with Depth: 0/1 + oc:offset, oc:limit |
=> moved to top post |
Beware that it will not be possible to combine => moved to top post |
|
make it part of the xml body |
@PVince81 Go for the simplest approach for v1, and we'll test-drive it in the new iOS app (owncloud/ios-app#53) and provide feedback… |
Yes. The interpretation of the search string will depend on each particular search provider. Our search service will just send the string to the provider without any manipulation on our part.
Having multiple search apps is possible. The results will be merged. If we only want to support a search provider we have to limit it somehow in the search service. Note that this limitation isn't planned, so we'll need to check possiblities.
No. The search_elastic app removes the core's provider and inserts its own, while the search_lucene just inserts the provider.
I don't think we should worry about duplicates as long as the clients are aware. If there are duplicates within a provider, blame the provider. We might want to separate the results somehow based on the provider: my provider returns these files, your provider these ones, etc, this would clarify what results come from what provider.
Yes, but it isn't properly implemented: it fetches all the results and then returns the slice we want. I don't think the provider will scale for large datasets, and fetching all the data (because the provider doesn't support pagination) won't help. The question here is whether we want to support pagination or not taking into account that there might be several search providers, at least until we decide to have only one provider. Instead of pagination we can have a limit, kind of "give me the first X results". This can be easier to handle on our side. The drawback is that we won't handle pages, so the
The backend call is the same. The UI present the results differently. |
Is there already an API that aggregates the results ? I'd assume that the web UI search field calls said API. We could just use the same and not worry about single or multiple providers. Regarding pagination: Yes, let's only add a limit and no offset. If no limit given, set a default one (or fail with 400, whatever we already do now). Don't let the server return infinite results. Did you check what format the results are returned in ? Are these easy to pack into PROPFIND-like response format ? Is additional lookup required ? |
Not really. The search service appends all the results from all the providers. It's part of the service.
Feels BAD. https://github.com/owncloud/core/blob/master/lib/public/Search/Result.php is what we should be handling at webdav level, and https://github.com/owncloud/core/blob/master/lib/private/Search/Result/File.php is what we'll likely be handling, with the risk of being private API. Looks like the intention was to use json_encode and run away with it. I don't know if we want to add a layer to be able to change what's below at some point in the future... |
There is already a report for tags, so I'll create another one for the search. It doesn't seem a good idea to mix things. |
Should we add |
PR ready in #31873 I think most of the "public" details are commented in the PR. Regarding performance, without changing the search service and likely replace it with a new one, I don't think we can optimize more than that. Maybe fiddling with the webDAV layer, but I'd prefer to touch as less as possible and let webDAV handle it own stuff. There are several cases that haven't been tested yet, mostly with large data (thousands of files) and some error handling. |
@jvillafanez master PR merged, please backport. Also please add a capability so the clients know this feature is available. In general it should already be possible to do an OPTIONS call on the files endpoint to find out that the new report type is available. However considering that most capabilities are listed in our capabilities endpoint, better add it there as well. I wonder if we should also expose a value telling what search API type is available (ex: regular search, full text search, etc) so the clients can display a text accordingly. |
Capabilities added in #31943 For the record, it's possible to check what reports are available through webDAV:
The expected response would be something like:
Note that the I'll backport both PRs at the same time. |
@jvillafanez you can also use the OPTIONS method and/or check response headers, likely easier |
It won't be enough. OPTIONS might check only if the REPORT method is available in the target endpoint, but it doesn't say anything about what reports are available
|
@jvillafanez thanks for confirming. I might have mixed up with the "DAV" header when remembering. |
@jvillafanez please raise documentation ticket and copy your usage examples there. This will be useful for client devs to start programming against this. |
documentation ticket in https://github.com/owncloud/documentation/issues/4241 |
Considering that Phoenix is providing the future files app, let's not invest time in the old files app regarding integration with this API. I've raised owncloud/web#172 for Phoenix integration. The remaining advanced search topics will be adressed in this separate ticket: #31993 |
Currently the REPORT method on the files DAV (from #22112) provides a way to filter by tags.
It should be extended to also allow specifying search attributes.
Eventually it should be possible for the search app to use this method instead of a private endpoint.
Backend changes
TODO: improve REPORT to work withoc:search
andoc:depth
: 2-4 mdTODO: improve REPORT to work without any search pattern (for PROPFIND pagination): 0.5-1mdFrontend changes
update files app search field to use REPORT=> Search files web#172instead of using PROPFIND for file list in web UI, use REPORT + pagination=> Search files web#172Follow up
follow up on more extended concept: Add search support on the REPORT method #25373 (comment)=> Extend Webdav files search API on REPORT #31993The text was updated successfully, but these errors were encountered: