Hi Jonas,
It looks OK and should work. Well works in our projects ;)
Does it make any difference if you change the module dependency in your module to: [ModuleDependency(typeof(EPiServer.Find.Cms.Module.IndexingModule))] so you can be sure your initialization happens after the Find initialization.
And your solution doesn't have code that would conflict with the above somewhere else? Do you have any third party add-ons that mights change Find behavior?
If you publish your start page, can you check if it runs into your ShouldIndex function (by placing a breakpoint in debug mode/logging etc.)?
Thanks for your suggestions, i'll look in to them and get back to you!
Edit:
You got me on the right track Antti. First of all, the ModuleDependency didn't make any difference, but you're are right, it should be set to IndexingModule anyway. But i did find a line of interferring code elsewhere!
This line really screw things up:
ContentIndexer.Instance.Conventions.ForInstancesOf<IContent>().ShouldIndex(x => !(x is IElementBlock));
Some one (not me of course :) ) wanted to exclude EPiServer Forms by adding this line, which (i believe) overrides my code since IContent is higher in the hierarchy?
When this line was removed my ShouldIndex function was called correctly.
Hi,
It seems my initialization module where i try to exclude things from being index is pretty much ignored. So i guess i've done something wrong. For example, i'm trying to exclude page types from being indexed like this:
But the startpage keep being indexed, and updated every time i publish it. So i tried another approach where i actually delete the page:
But that wouldn't work either. I'm pretty sure it worked when i first added the code... Any ideas?
My module looks like this: