Searching

Tamino supports the WebDAV SEARCH grammar (the WebDAV SEARCH specification formerly known as DASL), which specifies a search grammar known as DAV:basicsearch. The specifications of DASL and WebDAV SEARCH are available at https://tools.ietf.org/.The results of the SEARCH request method are the same as the results of a PROPFIND with the requested properties.

The client invokes the SEARCH method on a resource that will perform the search (the search arbiter) and includes a text/xml request entity that contains the query. The search arbiter performs the query. The search arbiter sends the results of the query back to the client in the response. The server sends a text/xml entity that matches the PROPFIND response.

WebDAV SEARCH is an application of HTTP/1.1. It is a lightweight search protocol for transporting queries and result sets. It allows clients to make use of server-side search facilities. WebDAV SEARCH minimizes the complexity of clients, thus facilitating widespread deployment of applications capable of utilizing the WebDAV SEARCH mechanisms which allows to negotiate a query language.

The WebDAV SEARCH standard defines the SEARCH method, the WebDAV SEARCH response header, the DAV:searchrequest XML element, and the DAV:basicsearch XML element and query grammar. The basic query language element enables searching for the existence or value of a property and searching for a substring in a resource content.


DAV:basicsearch Grammar

The basicsearch grammar provides an SQL-like query language (select ... from ... where ... order by ...) for selecting WebDAV documents (URLs) and optional associated WebDAV properties. The "where" clause restricts the result set by a boolean filter, where the boolean elements are WebDAV property comparisons, for example getContentLength > 1024.

If such a query is executed within the namespace of a Tamino store, the query is internally compiled into a corresponding Tamino XPath statement and directly executed in Tamino, obtaining optimum execution performance.

Example:

Find all mpeg resources in the mycoll store and display the URLs and the properties getcontenttype and getcontentlength.

Request:

<?xml version="1.0" encoding="UTF-8"?>
<searchrequest xmlns:D="DAV:">
  <D:basicsearch>
    <D:select>
      <D:prop>
        <D:getcontentlength/>
        <D:getcontenttype/>
      </D:prop>
    </D:select>
    <D:from>
      <D:scope>
        <D:href>/ino:dav/mycoll/</D:href>
      </D:scope>
    </D:from>
    <D:where>
      <D:eq>
        <D:prop>
          <D:getcontenttype/>
        </D:prop>
        <D:literal>audio/mpeg</D:literal>
      </D:eq>
    </D:where>
  </D:basicsearch>
</searchrequest>

Response:

<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/ino:dav/mycoll/sound/cathgirls.mp3</D:href>
    <D:propstat>
      <D:prop>
        <D:getcontentlength>471040</D:getcontentlength>
        <D:getcontenttype>audio/mpeg</D:getcontenttype>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  ...
  <D:response>
    <D:href>/ino:dav/mycoll/sound/camarillobrillo.mp3</D:href>
    <D:propstat>
      <D:prop>
        <D:getcontentlength>919928</D:getcontentlength>
        <D:getcontenttype>audio/mpeg</D:getcontenttype>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>