Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Hefin Jones 39 posts 161 karma points
    Jun 18, 2019 @ 14:40
    Hefin Jones

    Umbraco 8 Examine Index - supportProtected


    Does anyone know how to enable "supportProtected" on an Examin index - in v7 we could do this via the examinesettings.config file - but the config files are no longer available in v8.

    Any ideas?

  • mmaty 109 posts 282 karma points
    Jul 19, 2019 @ 09:42

    There is a ContentValueSetValidator class:

    var index = new LuceneIndex("SitemapIndex",
        new FieldDefinitionCollection(
            new FieldDefinition("updateDate", FieldDefinitionTypes.DateTime),
            new FieldDefinition("changeFrequency", FieldDefinitionTypes.Float)
        new StandardAnalyzer(Version.LUCENE_30),
        new ContentValueSetValidator(true, includeItemTypes:new string[]{ "BlogPost", "TextPage", "BlogOverview" }) );

    ContentValueSetValidator has a second constructor with a parameter 'supportProtectedContent'. I don't have any further insights, since the code of this class is not self-explanatory:

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Sep 25, 2019 @ 07:22
    Ismail Mayat

    Having this same issue. I already have the index the external one i need to just allow SupportProtectedContent and set it to true. Don't want to have to go through setting up the whole index again.

  • Marc Goodson 2149 posts 14354 karma points MVP 8x c-trib
    Sep 25, 2019 @ 09:10
    Marc Goodson

    Hi Ismail

    enter image description here

    It looks like in the source for examine

    that each index does have a ValueSetValidator property

    and this can be set to be a new instance of a ContentValueSetValidator which takes a parameter to support protected content or not...

    however as this property has it's 'set' protected, it can only be set via the constructor for the index, which you can only do when creating it afresh...

    enter image description here

    ... but I might be misunderstanding! and there may be another way...

    but looks like removing the existing index and creating a new one with the desired configuration is the way to go...

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Sep 25, 2019 @ 09:12
    Ismail Mayat


    Callum seems to think you can over ride, but i did see that protected property so could be you remove then re add afresh

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Sep 25, 2019 @ 13:54
    Ismail Mayat

    Ok so superstar callum came up with the goods with a package see

  • Bjarne Fyrstenborg 1281 posts 3991 karma points MVP 7x c-trib
    Mar 25, 2021 @ 15:04
    Bjarne Fyrstenborg

    Currently it seems the Umbraco Examine Config package has some issues, which cause a boot error - at least while testing on Umbraco v8.12.2:

    I implemented the following instead to enable SupportProtectedContent in ExternalIndex and close to the example documented here:

    using Examine;
    using Umbraco.Core;
    using Umbraco.Core.Composing;
    using Umbraco.Core.Scoping;
    using Umbraco.Core.Services;
    using Umbraco.Examine;
    using Umbraco.Web.Search;
    namespace My.Core.Composing
        public class CustomizeIndexComposer : IUserComposer
            public void Compose(Composition composition)
                // replace the default IUmbracoIndexConfig definition
                composition.RegisterUnique<IUmbracoIndexConfig, CustomIndexConfig>();
        // inherit from the default
        public class CustomIndexConfig : UmbracoIndexConfig, IUmbracoIndexConfig
            private readonly IPublicAccessService _publicAccessService;
            private readonly IScopeProvider _scopeProvider;
            public CustomIndexConfig(IPublicAccessService publicAccessService, IScopeProvider scopeProvider)
                : base(publicAccessService)
                _publicAccessService = publicAccessService;
                _scopeProvider = scopeProvider;
            // explicit implementation - overrides base class.
            IContentValueSetValidator IUmbracoIndexConfig.GetContentValueSetValidator()
                bool supportProtectedContent = true;
                return new ContentValueSetValidator(false, supportProtectedContent, _publicAccessService, _scopeProvider);
            // explicit implementation - overrides base class
            IValueSetValidator IUmbracoIndexConfig.GetMemberValueSetValidator()
                var excludeFields = Umbraco.Core.Constants.Conventions.Member.GetStandardPropertyTypeStubs().Keys;
                // include everything except the above
                return new MemberValueSetValidator(null, null, null, excludeFields);
            // explicit implementation - overrides base class.
            IContentValueSetValidator IUmbracoIndexConfig.GetPublishedContentValueSetValidator()
                bool supportProtectedContent = true;
                return new ContentValueSetValidator(true, supportProtectedContent, _publicAccessService, _scopeProvider);
Please Sign in or register to post replies

Write your reply to: