Copied to clipboard

Flag this post as spam?

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


  • Damion 96 posts 331 karma points
    Feb 25, 2020 @ 09:44
    Damion
    0

    Using Examine to search for Members by an extended property

    Can anyone tell me how I should change the following to search for Members who have the extended property organisationName = "test org"? The code runs but returns no results, I don't think I have it structured properly.

        if (ExamineManager.Instance.TryGetIndex("MembersIndex", out var index))
        {
               var searcher = index.GetSearcher();
               var results = searcher.CreateQuery("members").NodeTypeAlias("member").And().Field("organisationName", "test org").Execute();
               if(results.Any())
               {
                    ....
               }
         }
    
  • Mila Pandurska 75 posts 354 karma points
    Feb 26, 2020 @ 08:27
    Mila Pandurska
    0

    Hi Damion,

    If you go to Settings->Examine management->MembersIndex, do you see this property in IncludeFields list? If not you have to create Custom Index logic. You can start with the official Umbraco 8 documentation here: https://our.umbraco.com/documentation/reference/searching/examine/indexing/

    Please post some code if you already did this.

    Mila

  • 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