Copied to clipboard

Flag this post as spam?

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


  • Jose Guay 5 posts 76 karma points
    Oct 08, 2019 @ 22:20
    Jose Guay
    0

    Find all members with the same email address

    Hi.

    I'm wondering if there is an efficient way to retrieve all members using the Member Service that have the same email address but that is also from the same member type.

    By efficient I mean, I would not want to load all members, and then look for them with a second filter. Can it be done in one go?

    For example, I want to find all members with the email address "[email protected]" that are of member type (alias) "CustomMember".

    Thank you for any help.

  • Mila Pandurska 75 posts 354 karma points
    Oct 09, 2019 @ 06:36
    Mila Pandurska
    1

    Hi Jose, You can achieve this using Examine search and the build in InternalMemberIndexSet:

         var searcher = ExamineManager.Instance.SearchProviderCollection["InternalMemberSearcher"];
       var criteria = searcher.CreateSearchCriteria(BooleanOperation.And);
                criteria.NodeTypeAlias("CustomMember").And();
    criteria.GroupedOr(new[] { "email" }, "[email protected]").And();
    

    Mila

Please Sign in or register to post replies

Write your reply to:

Draft