We would like to apply custom filters while indexing Contacts in Sitecore. How can we apply filters on Mongo Data so that only specific contacts will get indexed


1 Answer 1


It looks like the code that decides if a contact should be indexed is defined in the contacts pipeline in the analytics.aggregation pipeline group. Specifically, the default processor is Sitecore.ContentSearch.Analytics.Aggregators.ContactChangeContactAggregator, which just checks contact.ShouldBeIndexed(), which in turn just checks if it is an anonymous contact, and if it is, whether anonymous contacts should be indexed. If you would like to add more complex logic, you should override this processor with a custom implementation and then patch in your own processor.

  • Thanks. I am able to add filter but contact which does not have Lease.Owner.Type are not getting indexed. I am getting null exception for those contacts. Please note we have migrated contact from External System to MongoDB. Jan 23, 2020 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.