Skip to content

Instantly share code, notes, and snippets.

@prjseal
Last active December 8, 2020 13:47
Show Gist options
  • Save prjseal/3c10ccc785e50b004ec1d85b28c89750 to your computer and use it in GitHub Desktop.
Save prjseal/3c10ccc785e50b004ec1d85b28c89750 to your computer and use it in GitHub Desktop.
Get members using Examine
public IEnumerable<ISearchResult> GetMembersByKeys(string[] memberKeys)
{
if (ExamineManager.Instance.TryGetIndex(Constants.UmbracoIndexes.MembersIndexName, out var index))
{
var searcher = index.GetSearcher();
var criteria = searcher.CreateQuery();
var query = criteria.GroupedOr(new[] { "__Key" }, memberKeys);
var searchResults = query.Execute();
return searchResults;
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment