Copied to clipboard

Flag this post as spam?

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


  • Kadir 30 posts 80 karma points
    Mar 22, 2012 @ 14:26
    Kadir
    0

    Examine with Razor - Excluding document types

     

    Hey,

    I am a new learner for Umbraco and I am working on a search solution for my project (v 4.7.1). I followed the example in farmcode's page.

    It's working super fine but my problem is; I only want to search on specific Document Types. In my project I have structure like below;

    TVShow (Doc Type: PageShow)
    --Season (Doc Type: PageSeason)
    ----Episodes (Doc Type: PageEpisode)

    When I make search It is searching for all but I want to limit it to only search for TV show nodeName.

    I tried to limit it with <ExcludeNodeTypes/> but It doesn't work and I believe, I am overlooking some important details. Lastly, I managed to make it work with @if(c.Fields.Keys.Contains("ShowCoverImage")) but I don't know if it is the best option. 

     

  • Sean Dooley 288 posts 527 karma points
    Mar 28, 2012 @ 17:29
    Sean Dooley
    0

    Maybe try deleting the generated index files (usually within the App_Data folder) therefore re-generating the index files.

  • Kadir 30 posts 80 karma points
    Apr 02, 2012 @ 00:02
    Kadir
    0

    Thank you for your answer and sorry for replying late.

    I have figured out my problem. When I correctly refered to the Search Provider that I made (like below), It worked fine.

    var searchResults = ExamineManager.Instance.SearchProviderCollection["MySearcher"].Search(searchString, true)

Please Sign in or register to post replies

Write your reply to:

Draft