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 URLs.
The format is:
CreateQueryRules -SiteUrl 'https://server' -Name 'UPS' -Synonyms 'UPS' -LinkTitle 'UPS' -LinkDescription 'UPS' -LinkUrl '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
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 Unified Logging Service 2m1i Verbose Adding event 8313 (category: Topology, product: SharePoint Foundation) to spam monitoring list 4cd1f49d-bf31-d015-53e9-8a3482f114fd
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.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at Microsoft.Office.Server.Search.Internal.UI.SearchObjectAdminPageBase.ErrorHandler(Object sender, EventArgs e) at System.Web.UI.TemplateControl.OnError(EventArgs e) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 4cd1f49d-bf31-d015-53e9-8a3482f114fd
When I tried to delete this custom query rule(s), the following error occurred:
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