I have extended the Umbraco 8 Member type by adding some custom fields.
I need to be able to search Members by one of these fields, 'organisationName' (that's it's alias), so when looking at Examine, I tried to add this to the members index like this:
private readonly IExamineManager _examineManager;
public CustomizeIndexComponent(IExamineManager examineManager)
{
_examineManager = examineManager;
}
public void Initialize()
{
// get the external index
if (!_examineManager.TryGetIndex("MembersIndex", out var index))
return;
// add a custom field type
index.FieldDefinitionCollection.TryAdd(new FieldDefinition("organisationName", FieldDefinitionTypes.FullText));
}
when I put a breakpoint on after the TryAdd I can see the new field, but in the back office it's not there when I look at the members index.
Am I going about this the right way, as in can I actually add my field to the members index, or should I create a new custom index based on the member?