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.
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.
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
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 :)
Thanks for linking to this,
was exactly what I needed.
Hi ,
I am stuck on this part, how did you solve the issue?
In a composition add an event handler for:
ContentCacheRefresher.CacheUpdated
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.
Hi Steve,
Yes, I did, and it's working now. I forget to update the thread, anyway thanks for the reply, much appreciated ;)
is working on a reply...