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 3 posts 33 karma points
    Jan 20, 2021 @ 15:45
    Steve Andrews
    0

    Custom Index on Azure not updating replica

    Hi

    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);
    catalogIndex.IndexItem(valueSet);
    

    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.

    Thanks.

    Steve

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

    Hi,

    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: https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web/Search/ExamineComponent.cs

    HTH :)

  • Steve Andrews 3 posts 33 karma points
    Jan 21, 2021 @ 12:52
    Steve Andrews
    0

    Thanks for linking to this,

    ContentCacheRefresher.CacheUpdated += ContentCacheRefresher_CacheUpdated;
    

    was exactly what I needed.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies