Using Examine to search for Members by an extended property
Can anyone tell me how I should change the following to search for Members who have the extended property organisationName = "test org"?
The code runs but returns no results, I don't think I have it structured properly.
if (ExamineManager.Instance.TryGetIndex("MembersIndex", out var index))
{
var searcher = index.GetSearcher();
var results = searcher.CreateQuery("members").NodeTypeAlias("member").And().Field("organisationName", "test org").Execute();
if(results.Any())
{
....
}
}
Using Examine to search for Members by an extended property
Can anyone tell me how I should change the following to search for Members who have the extended property organisationName = "test org"? The code runs but returns no results, I don't think I have it structured properly.
Hi Damion,
If you go to Settings->Examine management->MembersIndex, do you see this property in IncludeFields list? If not you have to create Custom Index logic. You can start with the official Umbraco 8 documentation here: https://our.umbraco.com/documentation/reference/searching/examine/indexing/
Please post some code if you already did this.
Mila
is working on a reply...