public virtual void Reindex(int itemID, bool affectsChildren)
        {
            var itemX = persister.Get(itemID);

            if (itemX == null)
            {
                return;
            }

            string            title    = itemX.Title;
            string            itemType = itemX.GetType().Name;
            IndexableDocument document = null;

            if (indexer.IsIndexable(itemX))
            {
                document = indexer.CreateDocument(itemX);
            }

            Execute(new Work
            {
                Name   = "Reindex #" + itemID + "[" + itemType + "]" + "(affectsChildren = " + affectsChildren + ")",
                Action = () =>
                {
                    // update the index
                    if (document != null)
                    {
                        currentWork = "Indexing: [" + itemType + "] " + " #" + itemID + " " + title;
                        indexer.Update(document);
                    }
                    else
                    {
                        currentWork = "Skipping: [" + itemType + "] " + " #" + itemID + " " + title;
                    }

                    if (affectsChildren)
                    {
                        var reindexIds = persister.Repository
                                         .Select(Parameter.Equal("Parent.ID", itemID), "ID")
                                         .Select(d => d["ID"]).Cast <int>().ToList();

                        foreach (var childId in reindexIds)
                        {
                            Reindex(childId, affectsChildren);
                        }
                    }
                }
            });
        }