![](https://csdnimg.cn/release/download_crawler_static/9435487/bg4.jpg)
Anatomy of a results set
The results returned for a request differ from SourceType to SourceType, but in every case they include
a header and a results body. The document element is always SearchResponse, with a Query child
element that contains the query used to produce the results. These two elements make up the header.
You can see this header in Figure 1, which shows results that the request in the previous section might
generate.
Figure 1: XML Results
The results body follows the header. If only one SourceType is used, there will be one additional child
element of SearchResponse after the Query element, but there can be more than one if multiple
SourceTypes are used. Each SourceType has its own XML namespace URI (and, therefore, its own
schema), but all SourceTypes share a common structure. In Figure 1, because the request was to the
Web SourceType, the body is an element named Web from the
http://schemas.microsoft.com/LiveSearch/2008/04/XML/web namespace.
Working with Total, Offset, and Count
The Web element subordinates two elements that are qualified by the web namespace, but are
common to all SourceTypes: Total and Offset. The Total element contains the estimated
1
number of
results for the request in that particular SourceType, while Offset indicates how far into the result set
you are currently processing. Each SourceType has a default number of results, which can be modified
using the optional Count parameter. You can change Offset using the optional Offset parameter. Since
1
Depending on how popular a query is, the estimated number of results could be very different from the real
number. Do not rely on this number for critical computation.