Copied to clipboard

Flag this post as spam?

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


  • Martin Almström 33 posts 159 karma points
    Apr 25, 2016 @ 10:16
    Martin Almström
    0

    Trigger GatherNodeData in load balanced environment

    Hi,

    I have a scenario where I need to trigger GatherNodeData (ReIndexNode) for a currently published node's children, since the child nodes read some properties from their parent and those properties need to be saved in the lucene-index.

    This only works on a singled machine: examineManager.IndexProviderCollection["CustomIndex"].ReIndexNode(...)

    Should I use content.Instance.UpdateDocumentCache(id) or is there a better way to do it?

    Running Umbraco 7.4.3

    Regards,

    Martin

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 26, 2016 @ 06:21
    Dave Woestenborghs
    100

    Hi Martin,

    Are you calling the ReIndex method from a ContentService published event ?

    In a loadbalanced environment you need to hook in to PageCacheRefresher.Updated event. This will fire on all loadbalanced instances, where the published event will only fire on the server that is doing the publishing.

    Dave

  • Martin Almström 33 posts 159 karma points
    Apr 26, 2016 @ 06:40
    Martin Almström
    0

    Hi Dave,

    I did call the ReIndexNode from ContentService Published event. Can't believe I didn't think of moving the Reindex-triggering to PageCacheRefresher.UpdateCache.

    Thank you so much! This works perfectly.

    Regards

    Martin

Please Sign in or register to post replies

Write your reply to:

Draft