Mode 元素 (搜尋連接器架構)

<模式> 專案會指定應該包含或排除在搜尋連接器範圍中的 URL。 允許的值是 IncludeExclude。 這個項目沒有子專案,也沒有屬性。

語法

<!-- mode -->
    <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:complexType>
                            <xs:all>
                                ...
                                <xs:element name="mode" default="Include">
                                    <xs:simpleType>
                                        <xs:restriction base="xs:string">
                                            <xs:enumeration value="Include"/>
                                            <xs:enumeration value="Exclude"/>
                                        </xs:restriction>
                                    </xs:simpleType>
                                </xs:element>
                                ...
                            </xs:all>
                        </xs:complexType>
                    </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 元素 子專案
scopeItem 元素 (搜尋連接器架構)  

 

言論

無法搜尋或流覽排除的範圍。 您可以巢狀 scopeItem URL。 例如,您可以加入父範圍及其所有子系,但除了其中一個新增父 URL,以及深度值為 Deep,以及排除子 URL 以外的所有子系。

下列範例顯示包含 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>Include</mode>
            <depth>Shallow</depth>
            <url>C:\ExampleFolder\ExcludeMe</url>
        </scopeItem>
    </scope>
    ...
</searchConnectionDescription>