Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • egeek 40 posts 179 karma points
    Nov 21, 2013 @ 16:55
    egeek
    0

    Starterkit seach function error

    Using the seach funtion in the starterkit returns: Error loading MacroEngine script (file: /search/products-view.cshtml)

    Exeception returned:
    Error Loading Razor Script (file: Search products view) Object reference not set to an instance of an object.    at ASP._Page_macroScripts_search_products_view_cshtml.Execute() in \macroScripts\search\products-view.cshtml:line 20
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
      at System.Web.WebPages.WebPage.ExecutePageHierarchy()
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

    Line 20 contains:

      IEnumerable<SearchResult> searchResults = ExamineManager.Instance.SearchProviderCollection[ "WebsiteSearcher" ].Search( searchString, true ).OrderByDescending( s => s.Score );

    I haven't changed anything in the search scripts.
    Thoughts?

  • Rune Grønkjær 1372 posts 3103 karma points
    Nov 25, 2013 @ 09:48
    Rune Grønkjær
    100

    Hi egeek,

    Maybe the "WebsiteSearcher" have been remove from your ExamineSettings.config file?

    It should look like this:

    <add name="WebsiteSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
    

     Otherwise you might need to debug the code in Visual Studio to find out exactly what is null. Something vital must have changed from the basic starter kit.

    /Rune

  • egeek 40 posts 179 karma points
    Nov 26, 2013 @ 10:56
    egeek
    0

    Hi Rune,

    Thanks, solved the problem. After upgrading to Umbraco 6.1.6 I did overwrite ExamineSettings.config.

  • Rune Grønkjær 1372 posts 3103 karma points
    Nov 26, 2013 @ 13:14
    Rune Grønkjær
    0

    Common mistake. Good thing you got it working. :)

    /Rune

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies