I'm currently trying to set up the Sitecore Publishing Service on an instance of Sitecore 10.1 (the page for all of the downloads and instructions is here)
Without the publishing service, we rely on 4 custom indexes to be updated when an item is published.
The "Publishing Module Installation and Configuration Guide" states the following about custom indexes (apologies for the formatting):
1.3.3 Configuring Cache Clearing and Indexing
The Sitecore.Publishing.Service.Delivery.config is responsible for raising events to rebuild the search indexes and clear data caches on the target instance. If additional custom indexes have been created on a Sitecore instance, each index name must be added to the publishingservice:searchindex.rebuild setting in the IndexNames section:
<event name="publishingservice:searchindex:rebuild">
<handler
type="Sitecore.Publishing.Service.Delivery.TargetSearchIndexRebuildHandler, Sitecore.Publishing.Service.Delivery" method="RebuildTargetSearchIndex">
<IndexNames hint="list:AddIndex">
<index>sitecore_web_index</index>
<customIndex>MyCustomIndex</customIndex>
</IndexNames>
</handler>
</event>
As such, I have the following in my configuration patch file:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<events>
<event name="publishingservice:searchindex:rebuild">
<handler type="Sitecore.Publishing.Service.Delivery.TargetSearchIndexRebuildHandler, Sitecore.Publishing.Service.Delivery" method="RebuildTargetSearchIndex">
<IndexNames hint="list:AddIndex">
<index>sitecore_web_index</index>
<customIndex>customindex_1</customIndex>
<customIndex>customindex_2</customIndex>
<customIndex>customindex_3</customIndex>
<customIndex>customindex_4</customIndex>
</IndexNames>
</handler>
</event>
</events>
</sitecore>
</configuration>
The resulting output when I go to admin/ShowConfig.aspx is the following:
<event name="publishingservice:searchindex:rebuild" patch:source="z.Sitecore.Publishing.Service.Delivery.Patch.config">
<handler type="Sitecore.Publishing.Service.Delivery.TargetSearchIndexRebuildHandler, Sitecore.Publishing.Service.Delivery" method="RebuildTargetSearchIndex" patch:source="z.Sitecore.Publishing.Service.Delivery.Patch.config">
<IndexNames hint="list:AddIndex" patch:source="z.Sitecore.Publishing.Service.Delivery.Patch.config">
<index>sitecore_web_index</index>
<customIndex patch:source="z.Sitecore.Publishing.Service.Delivery.Patch.config">customindex_4</customIndex>
</IndexNames>
</handler>
</event>
So it seems that the custom index declarations are overriding each other until only the last one remains.
How should I alter the configuration files so that all of the custom indexes will be updated when an item is published through the publishing service?