当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 从 SharePoint 搜索爬网中排除列

作者:精品下载站 日期:2024-12-14 13:43:55 浏览:14 分类:玩电脑

从 SharePoint 搜索爬网中排除列


要求:从 SharePoint 搜索中排除列。
默认情况下,SharePoint 搜索引擎会从列表和库中抓取所有文档及其关联的元数据属性并为其编制索引。在我们的示例中,我们在自定义 SharePoint 应用程序中保留了几个用于配置的字段,并且不希望这些字段出现在 SharePoint 搜索结果中。

这仅适用于 SharePoint 中的网站栏!

如何从 SharePoint 搜索中排除列?

以下是从 SharePoint 搜索中删除列的方法:

  • 单击设置齿轮导航至站点设置页面
  • 在“站点设置”页面上,单击搜索组下的“可搜索列”链接。

    [玩转系统] 从 SharePoint 搜索爬网中排除列

  • 选中要从搜索中隐藏的列旁边的复选框。
  • 单击“确定”保存更改。

这可确保 SharePoint 中的搜索引擎不会选取特定的元数据列,并排除当前网站中的网站列数据。

从搜索中排除字段的 PowerShell 脚本:

SharePoint字段/列有一个属性:NoCrawl,只需将其打开,我们就可以从SharePoint搜索中排除列!以下是我如何使用 PowerShell 关闭字段的搜索可见性:


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Set these two variables accordingly
$WebURL  = "https://sharepoint.crescent.com"
$FieldName = "ConfigData"

 #Get the Web
 $web = Get-SPWeb $WebURL

 #Get the field
 $Field = $web.Fields[$FieldName]
  
 #Set the search prefererence
 $Field.NoCrawl = $true
 $Field.Update($true)

它在搜索爬网发生后生效。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯