Copied to clipboard

Flag this post as spam?

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

  • Graham Carr 277 posts 389 karma points
    Mar 01, 2016 @ 16:08
    Graham Carr

    Examine search help

    I am trying to convert the following LINQ query into an examine query instead:

    .Where(x => x.IsApproved && x.GetValue("lastName").ToString().ToUpper().Substring(0,1) == dlLetters.SelectedValue)
    .OrderBy(candidate => candidate.GetValue("lastName"))

    I understand how to check for the IsApproved and the member type of candidate however I am not so sure on how to do the following in an Examine query:

    1. Search for last names that start with a chosen letter
    2. Order the results by last name

    Any help would be appreciated.

  • Veronica Burd 76 posts 200 karma points
    Mar 01, 2016 @ 17:37
    Veronica Burd


    You could use a wildcard. The lucene syntax would be something like this:

    +lastName: X*

    where X would be replaced with the result of dlLetters.SelectedValue



  • Graham Carr 277 posts 389 karma points
    Mar 02, 2016 @ 14:06
    Graham Carr


    This doesn't seem to work. If I have the following examine query:

    var memberQuery = searchCriteria.Field("nodeTypeAlias", "Candidate")
    .And().Field("lastName", dlLetters.SelectedValue + "*")
    .And().Field("umbracoMemberApproved", "1")

    and if for example the selected value in dropdown is B, when the search criteria is compiled it comes out as:


    So it converts the letter to lowercase and removes the * wildcard.

    Any ideas?

  • Graham Carr 277 posts 389 karma points
    Mar 02, 2016 @ 14:25
    Graham Carr

    I have worked this out, I had to use


    for the wildcard criteria field value.

Please Sign in or register to post replies

Write your reply to: