문제

I have created 3query rules in SharePoint 2013. I need to create query rule group using powershell and and define the ordering . anyone give me the better idea to create query rule group using powershell.

도움이 되었습니까?

해결책

Since you already have the query rules created you have the hard part out of the way. You need to decide for each rule whether you Continue or Stop after each rule is processed. This is the GroupProcessingDirective. For this sample your Query Rule is $qrPR.

#Pick Your Owner Scope
$owner = Get-SPEnterpriseSearchOwner -Level Ssa
#Create the filter
$ssaFilter =  New-Object Microsoft.Office.Server.Search.Administration.SearchObjectFilter($owner)
#Get the Group Collection
$qrGroups = $qrm.GetQueryRuleGroups($ssaFilter)
#Create a Query Rule Group
$newGroup = $qrGroups.CreateQueryRuleGroup("My New Demo Group")
#Add Rule To Group choose Continue or Stop
$newGroup.QueryRules.Add($qrPR,[Microsoft.Office.Server.Search.Query.Rules.GroupProcessingDirective]::Continue)
#Update the group
$newGroup.Update()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top