Custom index not updated on Subscriber server (LB)

Hi

I have a umbraco 13 solution behind a loadbalancer.
One SchedulingPublisher and one Subscriber.

The custom indexon the publicer are updating fine when I add/update/delete to the custom indexer.

I’m not sure how the make the Subscriber server to listen to a custom indexer is updated?

Anyone know I is missed something :slight_smile:

When loadbalancing the IServerMessenger publishes cache instructions to the subscriber instances so they know when to refresh the caches.

When fx the content cache is refreshed it emits a notification that the core has an indexing notification handler that listens to and ensures the content index is updated to reflect the changes:

Umbraco-CMS/src/Umbraco.Infrastructure/Search/IndexingNotificationHandler.Content.cs at release-13.9.1 · umbraco/Umbraco-CMS

So the missing link for you is probably that you have some sort of logic for keeping your index up to date, but that logic is not triggered on the subscriber sites unlike the cache notifications from the core is (which in turn trigger the notification handler that handles indexing).

Hey @jemayn

Thanks for you reply.
The data i’m indexing are in a custom table.
So I not sure how to get to notificationhandler to trigger on that ?

I’m writing to the index like this:

public void UpdateIndexChatWall(MessageWallTableSchema post, bool remove = false)
{
    if (!_examineManager.TryGetIndex(IntranetConstants.ChatwallIndexName, out IIndex? index))
    {
        throw new InvalidOperationException("Could not obtain the product index");
    }

    if (remove)
    {
        index.DeleteFromIndex(post.Id.ToString());
    }
    else
    {
        IEnumerable<ValueSet> valueSets = _intranetUserValueSetBuilder.GetValueSets(post);
        index.IndexItems(valueSets);
    }
}