Issue with searching (Query execution found more than one el

Posted by Community Admin on 04-Aug-2018 09:34

Issue with searching (Query execution found more than one element. )

All Replies

Posted by Community Admin on 07-Aug-2012 00:00

Just upgraded to 5.1 SP1 and when I do a search I get the following error:

Query execution found more than one element.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

-
This is displayed on the results page.
I've searched the forum but can't find any answers, can anyone shed some light on this please.

Thanks,
O.


Exception Details: System.InvalidOperationException: Query execution found more than one element.

Posted by Community Admin on 07-Aug-2012 00:00

I'm having the same issue with 5.1 SP1. 

Posted by Community Admin on 17-Aug-2012 00:00

Still having this issue, has anyone been able to fix it?

O.

Posted by Community Admin on 19-Aug-2012 00:00

We are have the same issue with 5.1 SP1
-Lino

Posted by Community Admin on 20-Aug-2012 00:00

Sitefinity 5.1 SP1 created a duplicate copy of the Search Result widget template and hence that error of “more than one element was found”. I deleted the new template that was created and it worked.  Easy fix for now.
-Lino

Posted by Community Admin on 20-Aug-2012 00:00

Thanks for posting! I have a couple of custom templates but we do have a duplicate "Titles, excerpts, URLs" template, do I just delete one of these? Does it matter which one?

In my list of templates I have:
Titles, exerpts, Urls
Our Custom Search List
Title, exerpts, Urls
Titles only


Posted by Community Admin on 20-Aug-2012 00:00

Hi,

There is a problem with the search results widget since in Sitefinity 5 the assembly where the search implementation resides was changed In the second screenshot you have provided you can see the first line in the error you get  Assembly="Telerik.Sitefinity" which is not correct. It should be Assembly="

Telerik.Sitefinity.Search.Impl". To fix the problem go to Design->Widget Templates and find all search related templates. If there are more than two templates delete two of them preferably those who have
Assembly="Telerik.Sitefinity" as referenced assembly in their template.

The first error is caused because of having more than one templates for search results with the problematic assembly.

Second make sure the templates for search results have markup like:

<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sitefinity" %>
<%@ Register Assembly="Telerik.Sitefinity.Search.Impl" Namespace="Telerik.Sitefinity.Services.Search.Web.UI.Public" TagPrefix="sfSearch" %>
  
  
<sfSearch:SearchBox ID="topSearchBox" runat="server" />
  
<sitefinity:SitefinityLabel id="resultsStats" runat="server" WrapperTagName="p" CssClass="sfsearchResultStatistics" Text="<%$Resources:SearchResources, SearchResultsStatusMessage %>" />
<asp:Repeater ID="resultsList" runat="server">
<HeaderTemplate>
<ol class="sfsearchResultsWrp sfsearchReultTitlesOnly">
</HeaderTemplate>
<ItemTemplate>
<li class="sfsearchResultTitle"><a href='<%# Eval("Link")%>'><%# Eval("Title") %></a></li>
</ItemTemplate>
<FooterTemplate>
</ol>
</FooterTemplate>
</asp:Repeater>
<sitefinity:Pager ID="pager" runat="server" />
  
<sfSearch:SearchBox ID="bottomSearchBox" runat="server" />

and for the template for Title, URL, Excerpt:

<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sitefinity" %>
<%@ Register Assembly="Telerik.Sitefinity.Search.Impl" Namespace="Telerik.Sitefinity.Services.Search.Web.UI.Public" TagPrefix="sfSearch" %>
  
<sfSearch:SearchBox ID="topSearchBox" runat="server" />
  
<sitefinity:SitefinityLabel id="resultsStats" runat="server" WrapperTagName="p" CssClass="sfsearchResultStatistics" Text="<%$Resources:SearchResources, SearchResultsStatusMessage %>" />
  
<asp:Repeater ID="resultsList" runat="server">
<HeaderTemplate>
<dl class="sfsearchResultsWrp sfsearchReultTitleSnippetUrl">
</HeaderTemplate>
<ItemTemplate>
<dt class="sfsearchResultTitle"><a runat="server" href='<%# Eval("Link")%>'><%# Eval("Title") %></a></dt>
<dd class="sfsearchResultSnippet"><%# Eval("Summary")%></dd>
<dd class="sfsearchResultUrl"><a runat="server" href='<%# Eval("Link")%>'><%# Eval("Link")%></a></dd>
<dd class="sfsearchResultHighLighter"><%# Eval("HighLighterResult")%></dd>
</ItemTemplate>
<FooterTemplate>
</dl>
</FooterTemplate>
</asp:Repeater>
<sitefinity:Pager ID="pager" runat="server" />
<sfSearch:SearchBox ID="bottomSearchBox" runat="server" />

Regards,
Stefani Tacheva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 20-Aug-2012 00:00

Brilliant thanks! That fixed it!

O.

This thread is closed