When configuring Sitecore Content Search to combine multiple related content items into individual Lucene documents, indexing.getDependencies pipeline can be used.
Configuring this pipelines has various known issues that are described in the current article.
More information about usage of the pipeline can be found in the Sitecore Search and Indexing Guide on the SDN.
When enabling GetDatasourceDependencies processor to fetch data sources from the item presentation settings, the following exception may appear in the log file:
Exception: System.InvalidCastException Message: Unable to cast object of type 'Sitecore.Data.ItemUri' to type 'Sitecore.ContentSearch.IIndexableUniqueId'. Source: System.Core at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at Sitecore.ContentSearch.Pipelines.GetDependencies.GetDatasourceDependencies.Process(GetDependenciesArgs context) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.ContentSearch.Abstractions.CorePipelineWrapper.Run(String pipelineName, PipelineArgs args) at Sitecore.ContentSearch.Pipelines.GetDependencies.GetDependenciesPipeline.GetIndexingDependencies(IIndexable indexable) at Sitecore.ContentSearch.Crawler`1.UpdateDependents(IProviderUpdateContext context, T indexable) at Sitecore.ContentSearch.SitecoreItemCrawler.DoUpdate(IProviderUpdateContext context, SitecoreIndexableItem indexable) at Sitecore.ContentSearch.Crawler`1.Update(IProviderUpdateContext context, IIndexableUniqueId indexableUniqueId, IndexingOptions indexingOptions) at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable`1 indexableInfo, IndexingOptions indexingOptions) at Sitecore.ContentSearch.AbstractSearchIndex.Update(IEnumerable`1 indexableInfo)
Solution:
To address this issue, apply the following patch:
Enabling GetDatasourceDependencies processor may also lead to System.StackOverflowException errors and unplanned recycling of the web application pool.
This happens when there are circular data source dependencies in the item's presentation setting.
An example of such circular dependency is when ItemA uses ItemB as a data source in its presentation, while ItemB refers to ItemA in its presentation details.
Solution:
To address this issue, apply the following patch:
Indexes for the source item may not be updated and indexing.GetDependencies pipeline would not be called when one of item's dependencies it deleted.
Solution:
Instead of using the indexing.GetDependencies pipeline, move the custom logic to a custom event handlers that are executed when the item is deleted from index: