Try our conversational search powered by Generative AI!

Excluding page type from Find index

Vote:
 

Hi,

How can I exclude few page type from being indexed by Episerver Find.

Thanks
Pankaj

#122756
Jun 11, 2015 18:47
Vote:
 

Please look at my blog post on detailed information on how to filter what to be indexed

http://world.episerver.com/blogs/Henrik-Fransas/Dates/2015/5/adding-episerver-find-to-alloy---part-2/

But simple way:

ContentIndexer.Instance.Conventions.ForInstancesOf<[ContentTypeName]>().ShouldIndex(x => false);
#122757
Jun 11, 2015 20:49
Vote:
 

I tried it, but for some reason i am getting the below error:

'EPiServer.Find.Cms.Conventions.IContentIndexerConventions' does not contain a definition for 'ForInstancesOf' and the best extension method overload 'EPiServer.Find.ClientConventions.ConventionsExtensions.ForInstancesOf<T>(EPiServer.Find.IClientConventions)' has some invalid arguments

Thanks

#122758
Jun 11, 2015 21:04
Vote:
 

What version of find are you on?

#122763
Jun 12, 2015 6:56
Vote:
 

Make sure you have included: 'EPiServer.Find.Cms.Conventions' (ForInstancesOf<>() is an extension method).

/Henrik

#122764
Jun 12, 2015 7:14
Vote:
 

Hi,

You Need to added the code suggested by Henrik F in Intialization module.

using EPiServer;
    using EPiServer.Commerce.Routing;
    using EPiServer.Commerce.SpecializedProperties;
    using EPiServer.Core;
    using EPiServer.Find.ClientConventions;
    using EPiServer.Find.Cms;
    using EPiServer.Find.Cms.Conventions;
    using EPiServer.Find.Framework;
    using EPiServer.Framework;
    using EPiServer.Framework.Initialization;
    using EPiServer.Security;
    using EPiServer.ServiceLocation;
    using EPiServer.Web.Routing;

public class CommerceInitialization : IConfigurableModule
    {
///
public void Initialize(InitializationEngine context)
        {
ContentIndexer.Instance.Conventions.ForInstancesOf<[ContentTypeName]>().ShouldIndex(x => false);
}
//
}

Regards

/K

#122773
Edited, Jun 12, 2015 9:59
Vote:
 

Its working now, I was missing the include.

Thanks

#122793
Jun 13, 2015 10:35
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.