範圍元素 (搜尋連接器架構)

選擇性 <範圍> 專案會指定 <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>