通过PowerShell自定义QueryRule删除导致异常“无效的URI" [英] Custom QueryRule removal via PowerShell caused an exception “Invalid URI”
问题描述
我最近为我的网站集创建了一系列自定义查询规则(实际上是提升的结果),其中包含自定义关键字,标题,名称,描述和URL.
I've recently created a bunch of custom query rules (in fact, promoted results) for my site collection, with custom keywords, titles, names, descriptions and URL's.
格式为:
CreateQueryRules -SiteUrl 'https://server' -Name 'UPS' -Synonyms 'UPS' -LinkTitle 'UPS' -LinkDescription 'UPS' -LinkUrl 'https://server2'
这里我隐瞒了整个代码,这意味着将以下参数传递给该函数:网站集URL,查询规则名称,升级结果名称,关键字和升级结果的URL(链接).
在执行期间,我在 -LinkUrl 参数上犯了一个错误,并将URL传递为"server2",而不是"https://server2".
错误发生后:
Here i suppress the whole code, meaning that the following parameters are passed to the function: site collection URL, query rule name, promoted result name, keywords and the URL (link) for promoted result.
During execution I've made a mistake with -LinkUrl parameter and pass the URL as "server2", not "https://server2".
After the error occurs:
Exception calling "Update" with "0" argument(s): "Invalid URI: The format of the URI could not be determined."
At F:\_install\create_query_rule(best_bet).ps1:32 char:1SERVER2date()
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : UriFormatException
我已经检查了下的网站集
https://server/_layouts/15/listqueryrules.aspx?level = sitecol
从您要在什么上下文中配置规则?" ->选择结果源->所有来源(从下拉列表中)和出了点问题:)
错误的详细信息是:
I've checked the site collection under
https://server/_layouts/15/listqueryrules.aspx?level=sitecol
From "For what context do you want to configure rules?" -> Select a result source -> All sources (from dropdown) and something went wrong :)
The error details are:
05/24/2017 17:41:39.61 w3wp.exe (SERVER:0x2848) 0x23F8 SharePoint Foundation General 8nca Medium Application error when access /_layouts/15/listqueryrules.aspx, Error=Invalid URI: The format of the URI could not be determined. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at
处的System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(消息答复,MessageFault错误,字符串操作,MessageVersion版本,FaultConverter faultConverter)
当我尝试删除此自定义查询规则时,发生以下错误:
When i tried to delete this custom query rule(s), the following error occured:
Exception calling "RemoveQueryRule" with "1" argument(s): "Invalid URI: The format of the URI could not be determined."
At line:3 char:1
+ $searchServiceApplication.RemoveQueryRule($qryRule)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : UriFormatException
任何指向正确方向的指针将不胜感激.
Any pointers to the right direction will be greatly appreciated.
推荐答案
Sergey,
Hi Sergey,
有些脚本可用于删除查询规则,请尝试一下:
There are some scripts that you could use to delete query rules, please have a try:
PowerShell在SharePoint 2013中创建和删除推荐的搜索结果
谢谢
这篇关于通过PowerShell自定义QueryRule删除导致异常“无效的URI"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!