Try our conversational search powered by Generative AI!

Reindex page when block in contentarea is changed.

Vote:
 

I use IndexInContentAreasAttribute on my block type, by doing so the content on my blocks are being index when the page is published/republished. If the block it self is updated the index for the page is not updated, so I need to change the block and then make a bogus change on my page or wait until the indexing job runs to make the new content searchable. Are there any built in feature that fixes this issue?

- Marcus

#151824
Aug 08, 2016 11:37
Vote:
 

Hi,

There is a convention to trigger a re-index when a block is changed. But this might slow down the indexing since the indexing que could end up really big, so be a bit cautious.

ContentIndexer.Instance.Conventions.ForInstancesOf<IContent>()
                .ReindexingRelatedContentWhenInContentArea(x => true);

Put this in an initializable module

#151839
Aug 08, 2016 15:12
Vote:
 

That did the trick, thanks!

- Marcus

#151850
Aug 08, 2016 16:49
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.