PowerShell:配置搜索结果Web第2部分. [英] PowerShell: Configuring Search Result web part 2.

查看:50
本文介绍了PowerShell:配置搜索结果Web第2部分.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在以编程方式在每个网站集的单个页面上的整个服务器场(100个或网站)中添加搜索结果Web部件.

I am adding Search Results web part programmatically over the whole farm(100 or sites) on a single page of each site collection.

我不需要在搜索结果中显示所谓的深层链接".有没有可以与下面的PowerShell代码一起使用的属性,以确保不会显示深层链接.我使用内容编辑器Web部件注入CSS样式来隐藏这些样式 行,但通过PS脚本执行此操作会更清洁.

I need the so called 'deep links' in the search results NOT to be displayed. Is there a property I can use in line with below PowerShell code to make sure that deep links do not get displayed. I used content editor web part to inject css styles to hide these lines, but it would be much cleaner to do it via the PS script.

PS脚本代码:

$ wp1 =新对象Microsoft.Office.Server.Search.WebControls.ResultScriptWebPart;
$ wp1.ShowAlertMe = $ false
$ wp1.ShowPreferencesLink = $ false

$wp1 = new-Object Microsoft.Office.Server.Search.WebControls.ResultScriptWebPart;
$wp1.ShowAlertMe = $false
$wp1.ShowPreferencesLink = $false

*深层链接是主要结果下方的链接,通常显示子站点.

*Deep links are links that are below the main result and that usually display subsites. 

谢谢.

N

Nemnaja Sovic

Nemnaja Sovic

推荐答案

嗨Nemnaja,

Hi Nemnaja,

对于您的请求,可以使用PowerShell脚本更改查询文本或结果源以限制结果.

For your request, you can use PowerShell script to change the Query text or result source to limit the result.

检查以下类似帖子作为参考:

Check following the similar posts as reference:

更新搜索结果Web部件:查询文本和结果源

Update Search Result Web Part: Query Text and Result Source

https://reshmeeauckloo.wordpress.com/2016/10/15/update-search-result-web-part-query-text-and-result-source/

使用PowerShell更新Office 365/SharePoint 2013中的搜索WebParts查询

Update Search WebParts Query in Office 365 / SharePoint 2013 using PowerShell

http://sharepointencounters.com/2016/02/16/update-search-webparts-query-in-office-365-sharepoint-2013-using-powershell/

最诚挚的问候,

Grace Wang

Grace Wang


这篇关于PowerShell:配置搜索结果Web第2部分.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆