November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
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 :)
Matt
Oh and I've also added:
using EPiServer.Find.ClientConventions;
But no luck yet..
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.
Matt
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.
Where are you trying to add it?
Could you show us the complete class where it does not work?
Hi Henrik
It does work with the above code that I marked as the answer.
Matt :)
Hi I am trying to use an API documented on http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/12/Integration/episerver-7-5/Indexing/
But the example for "ExcludeField" provided doesn't seem to work with Episerver.Find.Cms 12.2.4
Ideally I want to use an .IncludeField(x => x.something) if anyone knows if this also should exist?