I have a big import task in Umbraco 13 that builds out property pages. However, this used to then refresh the custom index for properties on the old site, but doesn’t seem to now on the new version.
Can I trigger a re-index from a controller action, or do I have more work to do?
I’ve tried this but I now suspect I’m actually missing the notification for the index. I don’t think it’s seeing content being published as a manually created property doesn’t appear when published. Is it possible to have a custom index with 2 notification handlers? One looking for when content is published and registering it on the index?
I’m still pretty new to this and the Umbraco 13 docs don’t really go into detail.
Thanks for your help! While the code didn’t solve the problem it lead me gradually to the source of the problem.
I have no idea how our v8 site was actually updating the index as it wasn’t actually doing a “saveandpublish” action on create. I’ve tweaked it now and it fingers crossed seems to be working. I’ll do some more testing then share and mark this as solved
If you have a completely custom index, you are responsible for updating the index records. I hope you don’t just rebuild the entire index all the time, because that would be torturing the CPU for no reason
The data for the indexes are ValueSets that are built with a ValueSetBuilder. When some action is performed or when some notification is triggered you can update single record by creating a ValueSet and only update that value set to the indexby calling Index.IndexItems(valueSets);
Yeah I know this but I wasn’t sure how it had been done by the previous developer. I’ve now got a proper publish notification in that indexes new items when they are published using the “SaveAndPublish” action. Seems efficient and hasn’t had any issues so far!
I had to build a handler for this: public class PropertyPublishIndexingNotificationHandler : INotificationHandler<ContentPublishedNotification>