[This is preliminary documentation and subject to change]

# Searching a WebDAV Directory

After you create a WebDAV publishing directory, you may want to allow users to search for content and file properties.

###### To set up your publishing directory for searching

1. If you want to let clients search for resource properties, make sure the directory is on a drive formatted for NTFS.

   If you put the directory on a drive formatted for the file allocation table (FAT) file system, clients can search for resource content but cannot search for resource properties.

2. Make sure Indexing Service is running on your server by typing the following at the command prompt:

   `net start cisvc`

3. In the IIS snap-in, check the Virtual Directory properties for your WebDAV directory to make sure Index this resource and Read access options are selected.

   If Index this resource is not selected, Indexing Service will not create a catalog for that directory, and therefore, no one will be able to search it. If Read access has not been selected, a client can search the directory, but will not be able to see the results of the search. For details on setting IIS permissions for a virtual directory, see Setting Web Server Permissions.

## Creating a Search Tool

The Microsoft implementation of WebDAV allows you to create a tool for clients to search a directory for content or properties or both. The following example shows a basic search command from which you can create a tool:

    SEARCH /webdav HTTP/1.1
    Host: iis
    Content-Type: text/xml
    Content-Length: 157

    <?xml version="1.0"?>
    <g:searchrequest xmlns:g="DAV:">
      <g:sql> Select "DAV:displayname"
                    FROM SCOPE()
      </g:sql>
    </g:searchrequest>

For details about creating a search tool, see the Microsoft® Platform SDK.

## Searching for Properties

There are two kinds of properties: server defined and user defined.

Server-defined properties include all properties created and maintained by the server. These properties are Read-only, and therefore, cannot be modified. Examples include the date a document was created and when it was last modified.

User-defined properties include all properties that can be created and modified by a user. Examples include the author of a document and the document's title. If you want clients to be able to find documents based on a user-defined property, you must create the property or make sure that it already exists.

Along with existing properties that users can define and modify, you can create your own custom properties. This means you could create a custom property called Source, which names any resource consulted in developing a document. A user could then search a site for all documents developed from a certain source. The following example shows a property which names resources at the Library of Congress.

    where contains ("Source", "Library of Congress")

Note Currently, WebDAV only supports searching for custom properties that are strings.

© 1997-2001 Microsoft Corporation. All rights reserved.