SaaS CMS has officially launched! Learn more now.

ContentIndexer IncludeField or ExcludeField?


Hi I am trying to use an API documented on

But the example for "ExcludeField" provided doesn't seem to work with Episerver.Find.Cms 12.2.4

  .ExcludeField(x => x.ACL)
The extension method ExcludeField is missing.. Am I missing a using??

Ideally I want to use an .IncludeField(x => x.something) if anyone knows if this also should exist?
Oct 30, 2016 17:34

Which usings do you have?

Oct 30, 2016 21:47

Hi Johan

I've got:

using EPiServer.Core;
using EPiServer.Find;
using EPiServer.Find.Cms;
using EPiServer.Find.Cms.Conventions;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;

Hopefully it's something easy I've missed :)


Oct 31, 2016 0:28

Oh and I've also added:

using EPiServer.Find.ClientConventions;

But no luck yet..

Oct 31, 2016 0:32

Okay, apparently since Epi v7.5 it should be done like this:

EPiServer.Find.Framework.SearchClient.Instance.Conventions.ForInstancesOf<PageData>().ExcludeField(x => x.ACL); // with using EPiServer.Find.ClientConventions;

Not sure why the official documentation suggests otherwise though.


Oct 31, 2016 0:44

OK! Note that it will only be in play on queries. ShouldIndex() is still on ContentIndexer if you want to stop a full IContent to going to the index and I think the recommended approach to not put a property's data in the index is to use the JsonIgnore-attribute.

Oct 31, 2016 8:22

Where are you trying to add it?

Could you show us the complete class where it does not work?

Oct 31, 2016 9:20

Hi Henrik

It does work with the above code that I marked as the answer.

Matt :)

Nov 01, 2016 2:04
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.