Copied to clipboard

Flag this post as spam?

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


  • Tim C 161 posts 528 karma points
    Jun 23, 2016 @ 16:05
    Tim C
    0

    Examine Umbraco.Search

    I have public access to restrict access to my test site : however, search does not work.

    In my partial View I am using

    Umbraco.Search(Query);

    I suspect it is using the ExternalSearchIndex which excludes protected pages. Can I force it to use either the InternalSearchIndex or maybe a custom one?

    If not, how can I use a search a against a specified index in Razor?

    Thanks

  • Lars-Erik Aabech 350 posts 1102 karma points MVP 8x c-trib
    Jun 27, 2016 @ 18:18
    Lars-Erik Aabech
    100

    You can do

    var searcher = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"];
    var result = searcher.Search(query, useWildcards);
    

    documented here:

    https://our.umbraco.org/documentation/reference/searching/examine/examine-manager

  • 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