0

In an experiment, I want to build the site specific index in the CD environment manually right after publish event. I created a processor which is hooked in the publish end event for rebuilding the index. This is now rebuilding of the entire sites index in a Sitecore instance.

This is time consuming in the publishing process. But what I want to achieve is that rebuild only the index specific to the items that are getting published from different sites like onpublishendasync update strategy, I assume this is how it does it. This means only the delta update not all the index. How do I achieve with manual strategy? Any suggestion would really be helpful.

  • 2
    I have to ask why you would try to replicate in built functionality with your own code. The short answer here is, you can't really achieve that. Sure you could change your event handler to only rebuild the web index, but that is still not doing what the onpublishendasync strategy does. That hooks into the publishing pipelines and updates the items in the index that have been affected, it does not do a full index rebuild. – Richard Seal May 28 at 1:59
  • In my experiment , I need to perform the below tasks sequentially on publish . 1. Pushing items to the database 2. Rebuild the indexes . This would allow me to have the next step( require updated web database and web index) to be performed sequentially . With onpublishendasync strategy , i can't do it is what i suppose as index building happens asynchronously .In the mean time , I am exploring the other update strategy i.e synchronous . It seems to be working but need to see if this is working in all the scenarios. – JTC May 28 at 7:30
  • When using onpublishendasync you should then be able to hook into the indexing:end event. There's other events as well if it doesn't need to happen on every indexing:end event, for example indexing:updateditem or indexing:deleteitem – Trayek May 28 at 8:39
  • @Trayek , In a Sitecore instance , I have multiple locale sites and have a separate index file for each locale . So my code logic would run after all the index files that are affected by the publishing of items . let us say i publish multiple items from two locale sites that would eventually rebuild two index files. In this scenario i can not run my code logic every indexing:end event . I am assuming the indexing:end event is for each index rebuilding – JTC May 28 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.