Get-SPEnterpriseSearchQueryScopeRule

傳回共用範圍規則。

Syntax

Get-SPEnterpriseSearchQueryScopeRule
   [[-Identity] <ScopeRulePipeBind>]
   -Scope <ScopePipeBind>
   [-Url <Uri>]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-SearchApplication <SearchServiceApplicationPipeBind>]
   [<CommonParameters>]

Description

The Get-SPEnterpriseSearchQueryScopeRule cmdlet reads a QueryScopeRule object when the shared scope rule is created, updated, or deleted. SPEnterpriseSearchQueryScopeRule represents a query result scope rule that can be applied to a scope.

在 SharePoint Server 中,結果來源會提供 SharePoint Server 中所提供範圍的功能。

從 SharePoint Server 升級期間,若要保留舊版設定,共用範圍會自動移轉。 不過,這些範圍在移轉之後會變成唯讀。 此 Cmdlet 可用來讀取已移轉之共用範圍的範圍規則。

從 SharePoint Server 升級期間,為了保留舊版設定,當對應的網站或網站集合移轉時,也會自動移轉本機範圍。 在 SharePoint Server 伺服器陣列中,處於 SharePoint Server 模式的網站或網站集合範圍是讀寫,而升級至 SharePoint Server 模式之後,網站或網站集合的範圍是唯讀的。 無論哪一種情況,此 Cmdlet 都可用來讀取所移轉之本機範圍的範圍規則。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

------------------範例------------------

$ssa = Get-SPEnterpriseSearchServiceApplication -Identity 'Search Service Application'
$scope = Get-SPEnterpriseSearchQueryScope -Identity MustCrawl -SearchApplication $ssa
Get-SPEnterpriseSearchQueryScopeRule -Scope $scope -Url https://criticalSite | Set-SPEnterpriseSearchQueryScopeRule -Url https://criticalSite -UrlScopeRuleType Url

這個範例會取得 URL https://criticalSite 的範圍規則參考,並將其規則類型設定為 URL。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要取得的範圍規則。

此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;有效的範圍規則名稱 (例如 ScopeRule1);或有效之 ScopeRule 物件的執行個體。

Type:ScopeRulePipeBind
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Scope

傳回指定範圍的查詢範圍規則。

此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;有效的範圍名稱 (例如 Scope1);或有效之 Scope 物件的執行個體。

Type:ScopePipeBind
Aliases:n
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-SearchApplication

指定包含查詢範圍規則集合的搜尋應用程式。

此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;有效的搜尋應用程式名稱 (例如 SearchApp1);或有效之 SearchServiceApplication 物件的執行個體。

Type:SearchServiceApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Url

此類型必須是格式為 https://server_name 的有效 URL。

傳回指定之結果 URL 的查詢範圍規則。

Type:Uri
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition