Copied to clipboard

Flag this post as spam?

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


  • Kim Andersen 1447 posts 2195 karma points MVP
    Jan 14, 2010 @ 21:46
    Kim Andersen
    0

    Exclude nodes with a specific nodeTypeAlias from searchresult

    This ain't a bug actually, but I'll give it a shot anyway. I use this excelent search-function on one of my sites, but I wonder if it's possible to exclude nodes with a certain nodeTypeAlias from the search results.

    My problem is, that I have a login-node, a 404-node and a couple of other nodes, that I don't want the user to see in the searchresult. Is it possible to exclude those nodes in some way?

     

    Thanks

    /Kim A

  • Douglas Robar 3570 posts 4671 karma points MVP 6x admin c-trib
    Jan 14, 2010 @ 22:04
    Douglas Robar
    1

    You can hide those nodes from XSLTsearch by setting the umbracoNaviHide property.

    Or, you could customize XSLTsearch to ignore certain document types using the instructions in this blog post:http://blog.percipientstudios.com/2009/4/7/customizing-xsltsearch.aspx

    cheers,
    doug.

  • Dirk De Grave 4535 posts 5983 karma points MVP 3x admin c-trib
    Jan 14, 2010 @ 22:05
    Dirk De Grave
    1

    It's not available oob afaik, but you can easily modify the source to exclude the nodes you don't want to appear in your search results, i'm thinking of of a couple of options:

    -Exclude the nodes in the xslt search file itself (look for the possibleNodes variable)

    -Add an extra property to your documents (excludeFromSearchResults) and also the check on that property in the possibleNodes variable)

     

    Hope this helps.

    Regards,

    /Dirk

     

  • Kim Andersen 1447 posts 2195 karma points MVP
    Jan 14, 2010 @ 22:12
    Kim Andersen
    0

    That's just great Doug. Looks like this is exactly what I need. Thanks :)

  • Kim Andersen 1447 posts 2195 karma points MVP
    Jan 14, 2010 @ 22:16
    Kim Andersen
    0

    @Dirk

    Ahh didn't see your answer before I answered. But your answer is great as well, and would have helped me also. Thanks, 1+.

  • Duncan McDougall 35 posts 62 karma points
    Nov 11, 2010 @ 18:48
    Duncan McDougall
    0

    It appears @nodeTypeAlias is no longer an accessible property of the item I'm using name()= 'homepage' instead.

Please Sign in or register to post replies

Write your reply to:

Draft