Search in comments

Hello,
Is there an API to search through all comments ?
I am looking for files that have comments containing a certain string.
It is easy to do directly in the database but I would like to do this from an external app using an API.
Thanks

I’ve had a quick look through the available APIs:
https://doc.owncloud.org/server/10.7/developer_manual/core/apis/

But unfortunately I didn’t find anything that could help you, so I would guess this API does not exist. Perhaps @jvillafanez knows more?

There is no API to search for comments.
You could try to implement a search provider in the comments app and create an API over the ownCloud’s search providers.

Basically, the comments app would register a search provider (you’ll have to implement it) to search for comments. You could use the ownCloud’s search to ask for results from a different ownCloud app.
If you want to access from somewhere outside the ownCloud environment, you’ll also need to create an API to expose the results.

You can check https://github.com/owncloud/core/blob/master/lib/private/Search.php and https://github.com/owncloud/core/blob/754e66a799dc045d81fbe8281dd8d8065a0d1e6e/lib/public/Search/PagedProvider.php#L30 as starting points.

1 Like

Thanks a lot for your feedbacks. I am trying to extend the provisioning_api app. This is very similar as searching for users or for groups.

Thomas Doki-Thonon