Copied to clipboard

Flag this post as spam?

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


  • Robert Freeland 18 posts 90 karma points
    Feb 16, 2021 @ 12:31
    Robert Freeland
    0

    Setting Examine.ExternalIndex.SupportProtectedContent = true

    I just need to set the Examine ExternalIndex to allow Protected Content in Umbraco 8.10.1. Seems like this may be a daunting task based on my research thus far. Does anyone have a solution? I have tried the Our.Umbraco.ExamineConfig package and added the appsettings to config but it doesn't seem to work in 8.10.1. Any help would be appreciated.

  • Marc Goodson 2157 posts 14434 karma points MVP 9x c-trib
    Feb 17, 2021 @ 08:42
    Marc Goodson
    0

    Hi Robert

    Yes it's all configurable via code nowadays - but if you are looking for a configuration file based approach have a look at this package:

    https://our.umbraco.com/packages/developer-tools/examine-config/

    should make the task of setting SupportProtectedContent a noncoding task!

    (but if you prefer to code - the source code for the package, shows you what's involved: https://github.com/callumbwhyte/umbraco-examine-config)

    regards

    Marc

  • Robert Freeland 18 posts 90 karma points
    Feb 17, 2021 @ 12:22
    Robert Freeland
    0

    Marc, I tried that Examine Config package and it doesn't appear to work in V 8.10.1. Do you know of any good tutorials that explain this config approach via code?

  • Marc Goodson 2157 posts 14434 karma points MVP 9x c-trib
    Feb 17, 2021 @ 15:50
    Marc Goodson
    0

    Hi Robert

    There is some documentation here:

    https://our.umbraco.com/Documentation/Reference/Searching/Examine/indexing/

    and poornima has a repository of code samples:

    https://github.com/poornimanayar/UmbracoLondonMeetup.Demo.V8Way/blob/b3d0f6800d677346d8cef6d2e442538cf299b6f5/LondonMeetup.Demo.V8Way/CodeSamples/Examine/ProductIndexCreator.cs

    The gist is, there are two ways - 1) to remove the index, and then create it again (or create a new one - see poornima's ProductIndex) when you create an Examine index in code you can set a new ContentValueSetValidator

    https://github.com/poornimanayar/UmbracoLondonMeetup.Demo.V8Way/blob/b3d0f6800d677346d8cef6d2e442538cf299b6f5/LondonMeetup.Demo.V8Way/CodeSamples/Examine/ProductIndexCreator.cs#L41

    and specify whether protected content should be supported...

    What Callum does in his package is a 2nd slightly different way - he instead overwrites the core 'UmbracoIndexesCreator' class:

    https://github.com/callumbwhyte/umbraco-examine-config/commit/e47a6ffa73630116dd8ccd8a2c64c0896b964c6d

    which is used by Umbraco core to create the indexes in the first place, and then applies the configuration from the xml files to them at the point of creation.

    So a lot depends on what you want to achieve - I often just use the InternalIndex and filter out content that isn't published if I want to search protected content... there is an overhead to having multiple Examine indexes, depends on the context of the site, but a super large site that needs to spin up quickly, not having an ExternalIndex can be an advantage!

    regards

    marc

  • Dan Evans 631 posts 1018 karma points
    Feb 19, 2021 @ 11:12
    Dan Evans
    0

    Would seem to be such a simple request. Changing a flag from false to true, that could have been done in seconds via a config file. Why regress things and make them so much more complicated!

  • Dan Evans 631 posts 1018 karma points
    Feb 19, 2021 @ 11:13
    Dan Evans
    0

    Callum's package would be perfect but it doesn't work in 8.11.1 presumably because Umbraco have changed how things work, again.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies