I want to add the ability for 'content editors' to forbid indexing certain pages. (bool property on page)
How to make a page with specific data don't fall in the index?
I know how can't index the page on its type, but with properties I don't found a good solution.
I hope for your help
We do this in our solution. In global application start I have some wiring for what Rind should index and not.
This line works on a bool property:
// Do not index pages with HideFromSearch set
ContentIndexer.Instance.Conventions.ForInstancesOf<BasePageData>().ShouldIndex(x => !x.HideFromSearch);
I tried this solution, but it only works after re-indexing (run job in admin mode).
Is it possible to somehow make the page is removed from the index after it publishing event?
PS I use the following code to search
Ok I had that problemt too before =)
Henrik gives a nice fix to the issue in this thread.
Thank you Petter