Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to convert the following LINQ query into an examine query instead:
ms.GetMembersByMemberType("Candidate") .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:
Any help would be appreciated.
Hi,
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
HTH,
Ver
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") .Compile();
and if for example the selected value in dropdown is B, when the search criteria is compiled it comes out as:
+lastName:b
So it converts the letter to lowercase and removes the * wildcard.
Any ideas?
I have worked this out, I had to use
dlLetters.SelectedValue.MultipleCharacterWildcard()
for the wildcard criteria field value.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Examine search help
I am trying to convert the following LINQ query into an examine query instead:
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:
Any help would be appreciated.
Hi,
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
HTH,
Ver
Hi,
This doesn't seem to work. If I have the following examine query:
and if for example the selected value in dropdown is B, when the search criteria is compiled it comes out as:
+lastName:b
So it converts the letter to lowercase and removes the * wildcard.
Any ideas?
I have worked this out, I had to use
for the wildcard criteria field value.
is working on a reply...