+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Issue with searching (Query execution found more than one element. )

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

8 posts, 1 answered
  1. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    07 Aug 2012
    Link to this post
    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.
  2. Andrew
    Andrew avatar
    1 posts
    Registered:
    04 Oct 2010
    07 Aug 2012
    Link to this post
    I'm having the same issue with 5.1 SP1. 
  3. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    17 Aug 2012
    Link to this post
    Still having this issue, has anyone been able to fix it?

    O.
  4. Lino
    Lino avatar
    45 posts
    Registered:
    06 May 2005
    19 Aug 2012
    Link to this post
    We are have the same issue with 5.1 SP1
    -Lino
  5. Lino
    Lino avatar
    45 posts
    Registered:
    06 May 2005
    20 Aug 2012
    Link to this post

    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

  6. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    20 Aug 2012
    Link to this post
    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


  7. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    06 Dec 2016
    20 Aug 2012
    Link to this post
    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
    Answered
  8. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    20 Aug 2012
    Link to this post
    Brilliant thanks! That fixed it!

    O.
8 posts, 1 answered