Skip to content

Instantly share code, notes, and snippets.

@icewind1991
Created February 2, 2017 17:26
Show Gist options
  • Save icewind1991/335d0559cbefa666e7895287189879e7 to your computer and use it in GitHub Desktop.
Save icewind1991/335d0559cbefa666e7895287189879e7 to your computer and use it in GitHub Desktop.
Example rfc5323 search query
<?xml version="1.0"?>
<d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
<d:basicsearch>
<d:select>
<d:prop>
<oc:fileid/>
<d:getcontenttype/>
<d:getetag/>
<oc:size/>
</d:prop>
</d:select>
<d:from>
<d:scope>
<d:href>/files/test</d:href>
<d:depth>infinity</d:depth>
</d:scope>
</d:from>
<d:where>
<d:or>
<d:and>
<d:gt>
<d:prop>
<oc:size/>
</d:prop>
<d:literal>10000</d:literal>
</d:gt>
<d:not>
<d:is-collection/>
</d:not>
</d:and>
<d:like>
<d:prop>
<d:getcontenttype/>
</d:prop>
<d:literal>text/%</d:literal>
</d:like>
</d:or>
</d:where>
<d:orderby>
<d:order>
<d:prop>
<oc:size/>
</d:prop>
<d:ascending/>
</d:order>
</d:orderby>
</d:basicsearch>
</d:searchrequest>
@icewind1991
Copy link
Author

This finds all files for the user 'test' that are either bigger than 10kb or are text files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment