scope 元素 (搜索连接器架构)

可选 <范围> 元素指定 <scopeItem> 元素的集合,这些元素定义此特定搜索连接器的范围包含和排除项。 如果存在 <范围>,则它必须至少包含一个 <scopeItem> 元素。 此元素没有属性。

语法

<!-- scope -->
    <xs:complexType name="searchConnectorDescriptionType">
        <xs:all>
        ...
        <xs:element name="scope" minOccurs="0">
            <xs:complexType>
                <xs:sequence minOccurs="0">
                    <xs:element name="scopeItem" maxOccurs="unbounded">
                       ...
                    </xs:element>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        ...
        </xs:all>
        <xs:attribute name="publisher" type="xs:string"/>
        <xs:attribute name="product" type="xs:string"/>
    </xs:complexType>

元素信息

Parent 元素 子元素
searchConnectorDescriptionType 元素(搜索连接器架构) scopeItem 元素(搜索连接器架构)

 

言论

使用 <范围> 和 <scopeItem> 元素来确定应搜索的位置以及应从搜索中排除哪些位置。

以下示例显示了包含 C:\ExampleFolder 及其所有子文件夹(C:\ExampleFolder\ExcludeMe 除外)的搜索范围。

<?xml version="1.0" encoding="UTF-8"?>
<searchConnectorDescription xmlns="http://schemas.microsoft.com/windows/2009/searchConnector">
    ...
    <scope>
        <scopeItem>
            <mode>Include</mode>
            <depth>Deep</depth>
            <url>C:\ExampleFolder</url>
        </scopeItem>
        <scopeItem>
            <mode>Exclude</mode>
            <depth>Deep</depth>
            <url>C:\ExampleFolder\ExcludeMe</url>
        </scopeItem>
    </scope>
    ...
</searchConnectionDescription>