Sitecore 8.1 update 3 brought a change that allows custom Contact
Data to be indexed. This means this Custom Contact data will be available to searched through the sitecore_analytics_index
.
This is implemented through a custom processor
that extends the new contactindexable.loadfields
pipeline
. This allows data from custom xDB facets to be added to the collection of contact indexable fields.
protected override IEnumerable<IIndexableDataField> GetFields(ContactIndexableLoadFieldsPipelineArgs args)
{
var fields = new List<IIndexableDataField>();
var customFacet = args.Contact.GetFacet<ICustomContactFacet>("CustomContactFacetName");
if (customFacet != null)
{
fields.Add(new IndexableDataField<bool>("contact.CustomFieldName", customFacet.CustomField));
}
return fields;
}
I have since written a detailed blog post on how to do this