Export (0) Print
Expand All

Search Response Format

SharePoint Portal Server 2001

A successful search results in a 207 Multi-Status response from the server. The content of the results are returned as text/xml. The syntax of the response follows:

HTTP/1.1 207 Multi-Status
Content-Type: text/xml
Content-Length: content-length
Content-Range: row-range; total-rows

<?xml version="1.0"?>
<dav-namespace-alias:multistatus 
    xmlns:dav-namespace-alias="DAV:" 
    xmlns:col-namespace-alias:"column-name-space" >
    <dav-namespace-alias:contentrange>
        content-range
    </dav-namespace-alias:contentrange>
    <dav-namespace-alias:response>
        <dav-namespace-alias:href>
            returned-item-url
        </dav-namespace-alias:href>
        <dav-namespace-alias:propstat>
            <dav-namespace-alias:prop>
                <dav-namespace-alias:status>
                    status-value
                </dav-namespace-alias:status>
                <col-namespace-alias:column-name>
                    column-value
                </col-namespace-alias:column-name>
            </dav-namespace-alias:prop>
        </dav-namespace-alias:propstat>
    </dav-namespace-alias:response>
</dav-namespace-alias:multistatus>

The preceding example shows the HTTP response headers for a Multi-Status response, including the Content-Type, Content-Length and Content-Range headers, and the required blank line separating the headers from the content. Row-range represents the range of rows returned. Total-rows respresents the total number of rows found.

HTTP/1.1 207 Multi-Status
Content-Type: text/xml
Content-Length: content-length
Content-Range: row-range; total-rows

The content of the response is an XML document following the DAV PROPFIND format. The first element indicates that this is an xml document.

<?xml version="1.0"?>

The next element opens the multistatus tag. The dav-namespace-alias is defined in this tag, and is used in many places in the response.

Searchable properties stored on SharePoint Portal Server are defined by, and obtained from, several sources. Each property is uniquely identified by a Uniform Resource Name (URN), which consists of a namespace and a name. The SQL query request specifies the rowset columns by naming the URNs of the stored properties. For more information, see SharePoint Portal Server Global Properties. When WebDAV returns columns that contain properties, each property namespace maps to an alias in the multistatus element. Each alias is a string that contains only the characters a-z. The col-namespace-aliases are arbitrarily assigned, and may be different in each request.

<dav-namespace-id:multistatus 
    xmlns:dav-namespace-alias="DAV:" 
    xmlns:col-namespace-alias:"column-name-space" >

The response elements are inside the multistatus element. There will be one response element for each row returned by the query.

    <dav-namespace-alias:response>

There are two types of elements inside the response element: href and propstat. The href element contains the Uniform Resource Identifier (URI) for the item specified in the query row. The href element is always returned, even when it is not requested in the SQL SELECT clause.

        <dav-namespace-alias:href>
            returned-item-url
        </dav-namespace-alias:href>

The propstat element contains a column returned for the row. Each response element will contain at least one propstat element, even if the query requested no columns. Each column is returned in a separate propstat element.

        <dav-namespace-alias:propstat>

There are two elements inside the propstat element: status and prop. The status element indicates the HTTP status for that column in the rowset. The status-value can be either "HTTP/1.1 200 OK", which indicates that the column has data, or "HTTP/1.1 404 Resource Not Found", which indicates that no value was found for this column in the row.

            <dav-namespace-alias:status>
                status-value
            </dav-namespace-alias:status>

The prop element contains a single element whose name is that of the column, and whose value is the returned value for the column.

            <dav-namespace-alias:prop>

The column element name consists of the column's namespace identifier, followed by the column name. The value of the element is the value of the property. If the column has no value for the row, this element will also have no value. When an empty column element returns with a 200 status, the property was set but has an empty value. When an empty column element returns with a 404 status, the property was not found on the item returned in the row.

                <prop-namespace-alias:propname>
                    property-value
                </prop-namespace-alias:propname>

There is only one column value in a prop element, and the prop element closes after the column element closes.

            </dav-namespace-alias:prop>

There is also only one prop element inside each propstat element. There will be one propstat element for each column in the request. After the propstat element is closed, the response element for the row is closed.

        </dav-namespace-alias:propstat>
    </dav-namespace-alias:response>

If there are additional rows in the response, there will be additional response elements. If there are no more rows, the multistatus element closes.

</dav-namespace-alias:multistatus>

Successful Response Example

The following is an example of a successful response.

HTTP/1.1 207 Multi-Status
Content-Type: text/xml
Content-Length: 677
Content-Range: rows=1-2; total=2

<?xml version="1.0"?>
<a:multistatus 
    xmlns:a="DAV:" 
    xmlns:b="urn:schemas.microsoft.com:fulltextqueryinfo">
    <a:response>
        <a:href>
            http://www.microsoft.com/ComputerSoftwareSuccess.htm
        </a:href>
        <a:propstat>
            <a:status>
                HTTP/1.1 200 OK
            </a:status>
            <a:prop>
                <b:Description>
                    Computers and Software
                </b:Description>
            </a:prop>
        </a:propstat>
    </a:response>
    <a:response>
        <a:href>
            http://www.microsoft.com/SofwareOnComputers.htm
        </a:href>
        <a:propstat>
            <a:status>
                HTTP/1.1 200 OK
            </a:status>
            <a:prop>
                <b:Description>
                    Software runs on computers.
                </b:Description>
            </a:prop>
        </a:propstat>
    </a:response>
</a:multistatus>

The preceding example shows two documents returned, each having one column of data from the Description property.

Related Topics

Requesting Row Ranges

Search Errors Format

Search Request Format

Special Characters in the Request




 

Show:
© 2014 Microsoft