Copied to clipboard

Flag this post as spam?

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


  • Dallas 132 posts 404 karma points
    Feb 12, 2021 @ 01:29
    Dallas
    0

    Backoffice Member search

    Hi, we want to search the member section using the custom member properties on the Member Type. It will be useful to the support team if they can search for members using the organization name and organization id properties that each member has.

    According to the documentation we need to:

    1. Index the member fields
    2. Override the UmbracoCustomSearchFields class

    Index the member fields

    By default only username and email are indexed but this can be changed by changing the indexing as described here:

    https://our.umbraco.com/documentation/Reference/Searching/Examine/indexing/

    This seems to be working as we can search on the member properties in the Examine Management dashboard. We can see all of the member properties are in the index.

    Override the UmbracoCustomSearchFields class

    By default the member search will only search on the username and email.

    This page in the documentation describes how to override the default field list by implementing IUmbracoTreeSearcherFields, a feature introduced in v8.6. but I feel like a step is missing in the guide.

    https://our.umbraco.com/Documentation/Extending/Backoffice-Search/

    How does the custom class get loaded?

    Thanks

    Dallas

  • Dallas 132 posts 404 karma points
    Feb 22, 2021 @ 17:58
    Dallas
    0

    I found that I needed to register the custom UmbracoTreeSearchFields class in a composer class.

    public class UmbracoTreeSearcherFieldsComposer : IUserComposer
        {
            public void Compose(Composition composition)
            {
                composition.RegisterUnique<IUmbracoTreeSearcherFields, CustomUmbracoTreeSearcherFields>();
            }
        }
    

    The details are in this answer:

    https://our.umbraco.com/packages/backoffice-extensions/ugardian/support/105083-search-in-custom-member-attributes#328062

Please Sign in or register to post replies

Write your reply to:

Draft