[玩转系统] SharePoint 搜索查询建议
作者:精品下载站 日期:2024-12-14 13:42:35 浏览:12 分类:玩电脑
SharePoint 搜索查询建议
搜索建议是 SharePoint 2010 中引入的重要新功能之一,并在 SharePoint 2013 中得到增强。搜索查询建议是当用户键入搜索查询时出现在搜索框下方的单词。 (也称为预查询建议)。
自动生成 SharePoint 搜索建议:
当用户单击该查询的任何搜索结果至少六次时,该查询将自动添加到搜索建议中。从技术上讲,每天,名为“准备查询建议”的 SharePoint 计时器作业都会处理编译它们。因此,对于不同的结果源和网站集,自动查询建议可能会有所不同。
尽管搜索查询建议是根据用户搜索自动填充的,但手动添加搜索查询建议以宣传 SharePoint 的特定区域会很有帮助。不是吗?
如何使用 PowerShell 添加 SharePoint 2013 搜索建议?
让我们使用 PowerShell 脚本添加 SharePoint 2010 搜索建议。
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
#Set the Terms to add in Search Suggestions
$SearchSuggestions = @("Crescent", "Crescent Policies", "Crescent News", "Crescent Tech", "Crescent Employee Of the Month", "Crescent Travel Request")
#Get the Search Service Application "Search Service Application" - Your's maybe in a different name
$ssa = Get-SPEnterpriseSearchServiceapplication -Identity "Search Service Application"
#Process Each Search Term
foreach ($Suggestion in $SearchSuggestions)
{
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language en-US -Type QuerySuggestionAlwaysSuggest -Name $Suggestion
}
#Trigger the Timerjob
$timerJob = Get-SPTimerJob "Prepare query suggestions"
$timerJob.RunNow()
也可以将它们放在 CSV 文件中并导入,而不是将它们放在硬编码数组中:
$csvfile = "D:\SearchSuggestions.csv" #with header "Suggestion"
$KeyWordsData = Import-Csv $csvfile
...
foreach ($Row in $KeywordsData)
{
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language en-US -Type QuerySuggestionAlwaysSuggest -Name $Row.Suggestion
}
...
您可以通过导航到中央管理和管理服务应用程序页面来获取搜索服务应用程序名称。
SharePoint 2010 搜索查询建议不起作用?运行计时器作业:“准备查询建议”。另外,请确保在搜索框 Web 部件属性中启用 SharePoint 2010 显示查询建议选项!结果:当用户在搜索框中键入关键字时,搜索中心会提供建议来帮助完成查询
要获取所有 SharePoint 2013 搜索查询建议:
#Get the Search Service Application "Search Service Application" by its name
$ssa = Get-SPEnterpriseSearchServiceapplication -Identity "Search Service Application"
#Get all Search Query suggestion
Get-SPEnterpriseSearchQuerySuggestionCandidates -SearchApplication $ssa
使用 PowerShell 删除搜索建议:
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
#Get the Search Service Application "Search Service Application" by its name
$ssa = Get-SPEnterpriseSearchServiceapplication -Identity "Search Service Application"
#Remove Search Query Suggestion "Crescent Employee Of the Month"
Remove-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language En-Us -Type QuerySuggestionAlwaysSuggest -Identity "Crescent Employee Of the Month"
#Trigger the Timerjob for the changes to take effect
$timerJob = Get-SPTimerJob "Prepare query suggestions"
$timerJob.RunNow()
如何手动添加 SharePoint 2013 搜索查询建议:
前往中央管理 >> 管理服务应用程序 >> 搜索服务应用程序 >> 点击查询建议链接左侧导航。从这里,您可以启用/禁用、导入/导出自定义搜索查询建议。
顺便说一句,导入查询建议会覆盖已创建的任何现有手动查询建议!所以,先导出,修改,然后再导入!
SharePoint 2013 搜索查询建议中的新增功能:
SharePoint 2013 中的情况略有不同,因为它允许在 SSA/网站集/网站级别自定义搜索参数。因此,我们有一个附加参数“Owner”来指定范围。此外,SharePoint 2013 中的查询建议与结果源也得到了改进。每天为每个结果源(每个网站集)生成查询建议。
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
#Set the Terms to add in Search Suggestions
$SearchSuggestions = @("Crescent", "Crescent Policies", "Crescent News", "Crescent Tech", "Crescent Employee Of the Month", "Crescent Travel Request")
#Get the default search service application
$ssa = Get-SPEnterpriseSearchServiceApplication
#You can also use: Get-SPEnterpriseSearchServiceapplication -Identity "Search Service Application"
$owner = Get-SPEnterpriseSearchOwner -level SSA
#Process Each Search Term
foreach ($Suggestion in $SearchSuggestions)
{
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name $Suggestion -Owner $owner
}
#Trigger the SharePoint 2013 query suggestions timer job
Start-SPTimerJob -Identity "Prepare query suggestions"
不要忘记运行 SharePoint 2013 查询建议计时器作业!
在 SharePoint 2013 中删除 SSA 级别的搜索建议:
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
#Get the default search service application
$ssa = Get-SPEnterpriseSearchServiceApplication
#Set the Query Suggestion Level
$owner = Get-SPEnterpriseSearchOwner -level SSA
#Get All Existing phrases
$SuggestionList = Get-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Owner $Owner -Language En-Us -Type QuerySuggestionAlwaysSuggest #-SourceId $ResultSource.Id
#Remove Them All
$SuggestionList | Remove-SPEnterpriseSearchLanguageResourcePhrase -Type QuerySuggestionAlwaysSuggest -Language "en-us" -Owner $Owner
#Trigger the SharePoint 2013 query suggestions timer job
Start-SPTimerJob -Identity "Prepare query suggestions"
在 SharePoint 2013 中的网站级别添加查询建议:
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
#Set the Terms to add in Search Suggestions
$SearchSuggestions = @("Crescent", "Crescent Policies", "Crescent News", "Crescent Tech", "Crescent Employee Of the Month", "Crescent Travel Request")
#Get the default search service application
$ssa = Get-SPEnterpriseSearchServiceApplication
$Web = Get-SPweb -Identity "https://sharepoint.crescent.com/sites/operations/"
$owner = Get-SPEnterpriseSearchOwner -Level SPWeb -SPWeb $web
$FederationManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager -ArgumentList $ssa
$ResultSource = $FederationManager.GetSourceByName("Local SharePoint Results", $owner)
#Process Each Search Term
foreach ($Suggestion in $SearchSuggestions)
{
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name $Suggestion -Owner $owner -SourceId $ResultSource.Id
}
#Its also possible to use PowerShell to Import Search Suggestions from text file using PowerShell
#$ssap = Get-SPEnterpriseSearchServiceApplicationProxy
#Import-SPEnterpriseSearchPopularQueries -SearchApplicationProxy $ssap -Filename "D:\querySuggestions.txt" -ResultSource $source -Web $web
#Trigger the timer job
Start-SPTimerJob -Identity "Prepare query suggestions"
这就对了!您已将查询建议添加到 SharePoint 搜索框。现在您开始输入 SharePoint,它将带来 SharePoint 建议。
猜你还喜欢
- 03-30 [玩转系统] 如何用批处理实现关机,注销,重启和锁定计算机
- 02-14 [系统故障] Win10下报错:该文件没有与之关联的应用来执行该操作
- 01-07 [系统问题] Win10--解决锁屏后会断网的问题
- 01-02 [系统技巧] Windows系统如何关闭防火墙保姆式教程,超详细
- 12-15 [玩转系统] 如何在 Windows 10 和 11 上允许多个 RDP 会话
- 12-15 [玩转系统] 查找 Exchange/Microsoft 365 中不活动(未使用)的通讯组列表
- 12-15 [玩转系统] 如何在 Windows 上安装远程服务器管理工具 (RSAT)
- 12-15 [玩转系统] 如何在 Windows 上重置组策略设置
- 12-15 [玩转系统] 如何获取计算机上的本地管理员列表?
- 12-15 [玩转系统] 在 Visual Studio Code 中连接到 MS SQL Server 数据库
- 12-15 [玩转系统] 如何降级 Windows Server 版本或许可证
- 12-15 [玩转系统] 如何允许非管理员用户在 Windows 中启动/停止服务
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[影视] 黑道中人 Alto Knights(2025)剧情 犯罪 历史 电影
[古装剧] [七侠五义][全75集][WEB-MP4/76G][国语无字][1080P][焦恩俊经典]
[实用软件] 虚拟手机号 电话 验证码 注册
[电视剧] 安眠书店/你 第五季 You Season 5 (2025) 【全10集】
[电视剧] 棋士(2025) 4K 1080P【全22集】悬疑 犯罪 王宝强 陈明昊
[软件合集] 25年6月5日 精选软件22个
[软件合集] 25年6月4日 精选软件36个
[短剧] 2025年06月04日 精选+付费短剧推荐33部
[短剧] 2025年06月03日 精选+付费短剧推荐25部
[软件合集] 25年6月3日 精选软件44个
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电视剧] 欢乐颂.5部全 (2016-2024)
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[影视] 【稀有资源】香港老片 艺坛照妖镜之96应召名册 (1996)
[剧集] 神经风云(2023)(完结).4K
[剧集] [BT] [TVB] [黑夜彩虹(2003)] [全21集] [粤语中字] [TV-RMVB]
[实用软件] 虚拟手机号 电话 验证码 注册
[资源] B站充电视频合集,包含多位重量级up主,全是大佬真金白银买来的~【99GB】
[影视] 内地绝版高清录像带 [mpg]
[书籍] 古今奇书禁书三教九流资料大合集 猎奇必备珍藏资源PDF版 1.14G
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电影] 美国队长4 4K原盘REMUX 杜比视界 内封简繁英双语字幕 49G
[电影] 死神来了(1-6)大合集!
[软件合集] 25年05月13日 精选软件16个
[精品软件] 25年05月15日 精选软件18个
[绝版资源] 南与北 第1-2季 合集 North and South (1985) /美国/豆瓣: 8.8[1080P][中文字幕]
[软件] 25年05月14日 精选软件57个
[短剧] 2025年05月14日 精选+付费短剧推荐39部
[短剧] 2025年05月15日 精选+付费短剧推荐36部
- 最新评论
-
- 热门tag