We have a custom database named Preview and are able to publish to this, but the preview index is not getting updated when an item is published. If we manually rebuild via the CMS, the item will then show in the index (and the page that references the index as its source for data).
We have the following configuration and have already tested clearing the Event Queue and the other recommendation to remove last updated from the Core database. We are running XM 10.2 so the Core database is only in use by the CMS:
Custom Index Strategy Defined
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/" xmlns:environment="http://www.sitecore.net/xmlconfig/environment/" xmlns:database="http://www.sitecore.net/xmlconfig/database/">
<!-- This patch file adds an index update strategy for the Preview database -->
<sitecore role:require="ContentManagement" search:require="solr" environment:require="PROD">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
</configuration>
<indexConfigurations>
<indexUpdateStrategies>
<onPublishEndPreviewAsync type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch" role:require="Standalone or ContentManagement or ContentDelivery">
<param desc="database">preview</param>
<CheckForThreshold>true</CheckForThreshold>
</onPublishEndPreviewAsync>
<onPublishEndPreviewAsyncSingleInstance type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousSingleInstanceStrategy, Sitecore.ContentSearch" singleInstance="true" role:require="Standalone or ContentManagement or ContentDelivery">
<param desc="database">preview</param>
<CheckForThreshold>true</CheckForThreshold>
</onPublishEndPreviewAsyncSingleInstance>
</indexUpdateStrategies>
</indexConfigurations>
</contentSearch>
</sitecore>
</configuration>
Custom Index Strategy Used
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/" xmlns:environment="http://www.sitecore.net/xmlconfig/environment/" xmlns:database="http://www.sitecore.net/xmlconfig/database/">
<sitecore role:require="ContentDelivery" search:require="solr" environment:require="PROD" database:require="preview">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="sitecore_preview_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">$(id)MainAlias</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" role:require="(ContentManagement and !Indexing) or (ContentDelivery and !Indexing)"/>
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndPreviewAsyncSingleInstance" role:require="Standalone or (ContentManagement and Indexing) or (ContentDelivery and Indexing)" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>preview</Database>
<Root>/sitecore</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>