When an item gets indexed, Sitecore also updates certain "dependent" items in the index. I would like to change this set of items, or at least add some to the list. I want to get the items in the list that Sitecore uses for indexing, to avoid starting new index jobs per extra item (as the list of extra items might get big).

How can I do this?

And two extra questions:

  • can I do this for each index separately? (I want this for my custom index, but not for all default Sitecore indexes)
  • does it matter if I use Lucene or Solr for this?

2 Answers 2


Check indexing.getDependencies pipeline

INDEXING GET DEPENDENCIES This pipeline fetches dependant items when one item is being index. Useful for fetching related or connected items that also need to be updated in the indexes.

You can add/remove entries from Dependencies collection (GetDependenciesArgs class)

Answers for extra questions:

  • yes you can, you can get info about your current job calling this Sitecore.Context.Job.Name (example result Index_Update_IndexName=sitecore_web_index). From this string you can get your custom index name,

  • it doesn't matter. This is an abstraction for search providers. It mean Sitecore crawls dependent items here and passes everything at the end to the search provider.

EDIT (problems with job name)

I treat this as a last resort solution. Perhaps there is something else that can be done easier.

Add dependencies in indexing.getDependencies pipeline.

To filter your items let's use document builder, where normally Sitecore does filtering. Find following types LuceneDocumentBuilderand LuceneDocumentBuilderOptions.

Options type inherits from DocumentBuilderOptions. Inside that type there is following property:

public virtual HashSet<string> ExcludedTemplates

and the most important one (which we can use for our filtering):

public virtual string IndexName { get; set; }

This ExcludedTemplates property is binded with values from config, example node:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
                <defaultLuceneIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
                    <exclude hint="list:ExcludeTemplate">

I know this is not a solution but having that knowledge you could try to add your custom filtering somewhere there. LuceneDocumentBuilderand LuceneDocumentBuilderOptions types can be patched via standard Sitecore configuration.

I assumed you are using Lucene as a serach provider. Solr has similar config nodes and it's own SolrDocumentBuilder as well.

  • The job name isn't working. You can get the name for the first item in each language, but not for the rest apparently. Seems like another thread is started and the job name is gone.. Any other ideas to manipulate this?
    – Gatogordo
    Oct 7, 2016 at 7:48
  • @gatogordo I just edited my answer with new approach. Oct 7, 2016 at 20:30

The answer from Alan certainly set me on the right track. The getDependencies pipeline was indeed the way to go. One more thing to add is a way to customize this per index: you can set in each index definition (and on a global level) if the getDependencies pipeline should be executed. This can be useful to trigger it when needed, but of course if you turn it off it's not only the custom code that gets turned off...

More info in this blog.

ps: there were some issues with the pipeline in 8.1, but most are fixed in upd3 (https://kb.sitecore.net/articles/116076).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.