Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Steve Andrews 4 posts 34 karma points
    Jan 20, 2021 @ 15:45
    Steve Andrews

    Custom Index on Azure not updating replica


    I've created load-balanced Azure Web App setup - 1 master admin and 1 (for now) replica front-end as per the docs.

    It seems to work fine - when I update a node in the admin then the index on the replica also appears to get updated.

    However I have also created a custom index but when I manually add something to the index on the admin instance then the change doesn't propagate to the replica e.g.

    IIndex catalogIndex;
    ExamineManager.Instance.TryGetIndex("Catalog", out catalogIndex);

    At this point the admin instance index has this new value but the replica doesn't and never seems to get it.

    Do I need to call something to notify the replica to update? Obviously the normal publish is doing something more complex than IndexItem() with the InternalIndex. Is this something to do with EnableDefaultEventHandler perhaps? I can't see how to set this in Umbraco 8 for a custom index.



  • Søren Gregersen 441 posts 1882 karma points MVP 2x c-trib
    Jan 20, 2021 @ 18:25
    Søren Gregersen


    You need something to tell the other servers to also index the item. This can be done with a CacheRefresher.

    There are examples in the ExamineComponent on how the refresh events can be handled to reindex an item:

    HTH :)

  • Steve Andrews 4 posts 34 karma points
    Jan 21, 2021 @ 12:52
    Steve Andrews

    Thanks for linking to this,

    ContentCacheRefresher.CacheUpdated += ContentCacheRefresher_CacheUpdated;

    was exactly what I needed.

  • Dhanesh Kumar MJ 155 posts 507 karma points c-trib
    Aug 25, 2021 @ 12:18
    Dhanesh Kumar MJ

    Hi ,

    I am stuck on this part, how did you solve the issue?

  • Steve Andrews 4 posts 34 karma points
    Aug 25, 2021 @ 13:50
    Steve Andrews

    In a composition add an event handler for:


    In your handler populate/remove the custom index items as required (as opposed for using ContentService_Published for example).

    This works across master/slave instances of Umbraco.

  • Dhanesh Kumar MJ 155 posts 507 karma points c-trib
    Aug 25, 2021 @ 17:09
    Dhanesh Kumar MJ

    Hi Steve,

    Yes, I did, and it's working now. I forget to update the thread, anyway thanks for the reply, much appreciated ;)

Please Sign in or register to post replies

Write your reply to: