scopeItem 元素 (搜尋連接器架構)
<scopeItem> 專案代表排除/包含範圍數據表中的單一專案。 <scopeItem> 藉由新增三個新元素來控制包含和排除資料夾、控制結果深度,以及指定範圍的位置,來擴充標準 shellLinkType 類型。 如果 <範圍> 專案存在,則需要這個專案。 它有三個子元素,沒有屬性。
語法
<!-- scopeItem -->
<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:element>
<xs:element name="depth" default="Shallow" minOccurs="0">
...
</xs:element>
<xs:element name="url" type="xs:anyURI"/>
</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 元素 | 子專案 |
---|---|
scope 元素 (搜尋連接器架構) | scope 元素 (搜尋連線器架構)。 |
scope 元素 (搜尋連線器架構)。 | |
scopeItem url 元素 (搜尋連接器架構)。 |
言論
使用 <範圍> 和 <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>