Copied to clipboard

Flag this post as spam?

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


  • Chris Koiak 700 posts 2626 karma points
    Nov 11, 2012 @ 22:28
    Chris Koiak
    1

    Can't get the search results to work

    If you can't get the search results to work then try

    • Touching the web.config to bounce the application
    • Republish any page
    If it still doesn't work then I'd advice downloading one of the Examine helper packages and rebuild your indexes.

  • Chen 39 posts 68 karma points
    Nov 13, 2012 @ 11:11
    Chen
    0

    Hi Chris,

    First of all, great package! I'm experiencing some problems with the search page if you could help that'd great. 

    Basically, whenever I navigate to the search page I get the YSOD - 

    Object reference not set to an instance of an object.

    Line 11: {
    Line 12:  <ul>
    Line 13: @foreach (var node in parent.Children.Where(x => x.IsVisible() && !x.IsDocumentType("NewsArticle"))) Line 14:     {
    Line 15:       var selected = Array.IndexOf(Model.Path.Split(','), node.Id.ToString()) >= 0 ? " class=\"selected\"" : "";

    I have not made any modification to the code, just wondering if there's something that I missed.

     

    Thanks in advance!

    Chen

  • Chris Koiak 700 posts 2626 karma points
    Nov 13, 2012 @ 14:39
    Chris Koiak
    0

    Hi Chen,

    Looks like it may be a problem with the publishing of the pages. Can you try republishing all pages?

    Failing that can you let me know the exact line that's throwing the error.

    Cheers,

    Chris

  • Chen 39 posts 68 karma points
    Nov 13, 2012 @ 15:54
    Chen
    0

    Hi Chris,

    I just republished the whole site the now. However, it didn't get rid of the problem. I noticed that there isn't a search 'page' in the 'Content' area, only the search.cshtml in the 'Templates' section. Do you think that's the cause?

    Thanks!

    Chen

  • Chris Koiak 700 posts 2626 karma points
    Nov 13, 2012 @ 15:55
    Chris Koiak
    0

    Yep, you should have a content page called Search. This is a a Standard doctype with the template set to 'Search'.

     

  • Chen 39 posts 68 karma points
    Nov 13, 2012 @ 16:06
    Chen
    1

    Fixed! I created a 'search' page in the 'Content' section, and the problem went away. I think Umbraco was confused with the 'Model' when there wasn't an actual page.

    Thanks for your replies Chris.

    Chen

  • Damian Green 452 posts 1433 karma points
    Nov 30, 2012 @ 13:01
    Damian Green
    0

    Does this mean that you can no longer use the template alias as a page?

    i.e. before just having a template named search would trigger that to be used for the search.

    ** Just to update - this still works for templates & altTemplates so how come it doesnt work for the search/code in a template? Just asking to get my head around this part of umbraco the MVC stuff.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft