Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How to enable SupportProtectedContent for an external index in Umbraco 11?
Hi Marius,
You need to customise the External Index.
See here:
https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#creating-a-configureoptions-class
Inside the Configure method:
if (name.Equals(Constants.UmbracoIndexes.ExternalIndexName)) { options.Validator = new ContentValueSetValidator(true, true, _publicAccessService, _scopeProvider, null, null); }
setting second parameter of ContentValueSetValidator to true enables SupportProtectedContent.
Cheers,
Marc
Thanks that solved my problem
Great, thanks for letting me know that worked.
IComposer is called from startup.cs and it won't let you get to the _publicAccessService in start-up, so how have you managed to get this working ?
Hi Roger,
In you class that inherits from IComposer add the following:
//Custom Examine configuration builder.Services.ConfigureOptions<ConfigureIndexOptions>();
Create a new class:
public sealed class ConfigureIndexOptions : IConfigureNamedOptions<LuceneDirectoryIndexOptions>
Inject IPublicAccessService in your constructor.
Let me know if that helps.
Do anyone know how to do it in Umbraco 13? Constructor with IScopeProvider is obsolete. Thanks!
Hi Bartosz,
Same approach in Umbraco 13. I do not use IScopeProvider in this example. Where do you think you need to use this?
ContentValueSetValidator requires IScopeProvider to be passed into constructor
I use:
options.Validator = new ContentValueSetValidator(true, true, _publicAccessService, null, null, null);
This works for me.
Will try to, thanks a lot!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to enable SupportProtectedContent for external index?
How to enable SupportProtectedContent for an external index in Umbraco 11?
Hi Marius,
You need to customise the External Index.
See here:
https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#creating-a-configureoptions-class
Inside the Configure method:
setting second parameter of ContentValueSetValidator to true enables SupportProtectedContent.
Cheers,
Marc
Thanks that solved my problem
Great, thanks for letting me know that worked.
IComposer is called from startup.cs and it won't let you get to the _publicAccessService in start-up, so how have you managed to get this working ?
Hi Roger,
In you class that inherits from IComposer add the following:
Create a new class:
Inject IPublicAccessService in your constructor.
Let me know if that helps.
Cheers,
Marc
Do anyone know how to do it in Umbraco 13? Constructor with IScopeProvider is obsolete. Thanks!
Hi Bartosz,
Same approach in Umbraco 13. I do not use IScopeProvider in this example. Where do you think you need to use this?
Cheers,
Marc
ContentValueSetValidator requires IScopeProvider to be passed into constructor
I use:
This works for me.
Will try to, thanks a lot!
is working on a reply...