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, 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?
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
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!
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!
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.
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
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?
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
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!
Callum's package would be perfect but it doesn't work in 8.11.1 presumably because Umbraco have changed how things work, again.
is working on a reply...