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 38 posts 160 karma points
    Jun 18, 2019 @ 14:40
    Hefin Jones
    0

    Umbraco 8 Examine Index - supportProtected

    Hello!!

    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 87 posts 216 karma points
    Jul 19, 2019 @ 09:42
    mmaty
    0

    There is a ContentValueSetValidator class:

    var index = new LuceneIndex("SitemapIndex",
        CreateFileSystemLuceneDirectory("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:

    https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/src/Umbraco.Examine/ContentValueSetValidator.cs

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

    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 1415 posts 9546 karma points MVP 5x c-trib
    Sep 25, 2019 @ 09:10
    Marc Goodson
    0

    Hi Ismail

    enter image description here

    It looks like in the source for examine

    https://github.com/Shazwazza/Examine/blob/864168c7f019908242dd56197e075edea5ee77cf/src/Examine/Providers/BaseIndexProvider.cs

    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 10058 karma points MVP 2x admin c-trib
    Sep 25, 2019 @ 09:12
    Ismail Mayat
    0

    Marc,

    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 10058 karma points MVP 2x admin c-trib
    Sep 25, 2019 @ 13:54
    Ismail Mayat
    100

    Ok so superstar callum came up with the goods with a package see https://github.com/callumbwhyte/umbraco-config-contrib

Please Sign in or register to post replies

Write your reply to:

Draft