---
title: Related content and dependencies
slug: cms-12/docs/related-content-and-dependencies
docTags: 
createdAt: 2026-08-10T15:55:54.000Z
---

:::hint{type="info"}
**Note**
This functionality is not related to finding similar or related content. For such functionality, use the `MoreLike` method, described in the [Search](docId\:ubMxc8DlIS7wjfw3n04xI) section.
:::

Sometimes, to preserve consistency in the index, it is necessary to index saved or published content and related content. For example, you indexed the child count for content and want it updated whenever "child content" is published.

To index related content, set the `RelatedContent` convention to return parent content when indexing. It reindexes the parent content and updates the child count.

```csharp
ContentIndexer.Instance.Conventions
  .ForInstancesOf < IContent > ()
  .RelatedContent(x => {
    var relatedContent = new List < IContent > ();
    if (!(x.ContentLink.CompareToIgnoreWorkID(ContentReference.StartPage) ||
        x.ContentLink.CompareToIgnoreWorkID(Contentference.RootPage))) {
      relatedContent.Add(DataFactory.Instance.Get < IContent > (x.ParentLink));
    }
    return relatedContent;
  });
```
