Skip to main content

Digital Transformation

Sitecore: Moving Indexed Content Tree Items

If you’ve ever worked with large amounts of data within Sitecore, chances are you’ve worked with Lucene Indexes (or the newly branded Sitecore.Search namespace and indexes).  If you haven’t worked with these, it’s worth the time (and initial frustration) to learn about them, as they really do improve performance when querying the Sitecore content tree.  There are of course some gotchas relating to Indexes though.  One I’ve already covered is using a MustNot QueryOccurance.  Another is what happens when a content manager moves an item into or out of a folder that is the root for one of your indexes?  This post will cover some of our experiences in how you can get your indexes to properly display accurate data in this situation.

When we built Perficient.com using Sitecore, we set up a number of Sitecore Search indexes for different pieces of our data, like Events and Awards.  One of the issues we ran into was that our indexes weren’t updating properly if a content manager dragged a content item from a folder that was indexed, and moved it into another folder (either indexed, or non-indexed).  We did some experimenting, and came up with the following fairly simple and straight-forward rule set regarding moving content that is in indexed folders.

Moving Content into or out of an index

  1. If you remove items from an indexed folder by dragging them to another folder or by deleting them, you must Smart Publish the indexed folder.  If you publish incrementally, the index will not be rebuilt.  Worse, Smart Publish or Republishing after an incremental publish will NOT correct the problem.  At that point, the only thing that works is to Rebuild the index with the Index Viewer.
  2. The same is not true of dragging items into an indexed folder.  Any kind of publish will update the index

After we discovered those sets of rules, we came to the simple conclusion that when training content managers, we need to point out to them what the indexed folders are and tell them that whenever they update an item within one of those folders, they should perform a Smart Publish.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Jamie Stump

My name is Jamie Stump, and I am a Senior Sitecore Consultant at Perficient. I was honored to be named one of only 42 2013 Sitecore MVP’s worldwide. I specialize in Sitecore Architecture and Development and my broad Sitecore experience includes Sitecore installation, configuration and CEP development, including custom DMS implementations for clients. I have implemented Sitecore solutions for a number of industry verticals including manufacturing, healthcare, financial services, advertising and retail. In addition to architecting and implementing Sitecore sites and eCommerce solutions, I also work with other Microsoft Technologies, including the .NET platform and SQL Server. You can read through my older Sitecore related blog posts here and my newer ones here. I graduated with a Bachelor of Science in Information Systems Development from York College of PA. I am originally from the suburbs of Philadelphia, PA, and still reside there with my wife, son, English bulldog and 2 cats.

More from this Author

Follow Us