Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1347 posts 1608 karma points
    Jun 16, 2017 @ 11:37
    Gordon Saxby
    0

    Examine search of Members not working

    I have added "clientId" and "dateOfBirth" to the Member index, by adding the following to ExamineIndex.config:

    <IndexUserFields>
      <add Name="clientID" EnableSorting="true" />
      <add Name="dateOfBirth" />
    </IndexUserFields>
    

    But when I run this code I get no results:

            var dobString = dobDate.Value.ToString("s");
            var sc = ExamineManager.Instance.CreateSearchCriteria(IndexTypes.Member);
            var query = sc.Field("clientID", model.ClientId).And().Field("dateOfBirth", dobString);
            var results = ExamineManager.Instance.Search(query.Compile());
    

    There is most definitely 1 member record with those details.

    If I run the following in the Examine section of the Umbraco backend, I get the result I expect:

    +clientID:8268100408 +dateOfBirth:"1962-07-01T00:00:00"
    

    So, why is my code not getting any results?

  • 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