/// <summary> /// Deletes the item. /// </summary> /// <param name="itemId">The item id.</param> /// <param name="context">The context.</param> protected virtual void DeleteItem(ID itemId, IndexDeleteContext context) { Assert.ArgumentNotNull(itemId, "itemId"); Assert.ArgumentNotNull(context, "context"); context.DeleteDocuments(context.Search(new PreparedQuery(this.GetItemQuery(itemId))).Ids); }
/// <summary> /// Deletes the tree. /// </summary> /// <param name="rootId">The root id.</param> /// <param name="context">The context.</param> protected void DeleteTree(ID rootId, IndexDeleteContext context) { Assert.ArgumentNotNull(rootId, "rootId"); Assert.ArgumentNotNull(context, "context"); context.DeleteDocuments(context.Search(new PreparedQuery(this.GetDescendantsQuery(rootId))).Ids); }
protected virtual void DeleteVersion(ID id, string language, string version, IndexDeleteContext context) { Assert.ArgumentNotNull(id, "id"); Assert.ArgumentNotNull(language, "language"); Assert.ArgumentNotNullOrEmpty(version, "version"); Assert.ArgumentNotNull(context, "context"); context.DeleteDocuments(context.Search(new PreparedQuery(this.GetVersionQuery(id, language, version))).Ids); }
/// <summary> /// Deletes the specific version information from the index. /// </summary> /// <param name="id">The item id.</param> /// <param name="language">The language.</param> /// <param name="version">The version.</param> /// <param name="context">The context.</param> protected override void DeleteVersion(ID id, string language, string version, IndexDeleteContext context) { base.DeleteVersion(id, language, version, context); ItemUri versionUri = new ItemUri(id, Language.Parse(language), Version.Parse(version), Factory.GetDatabase(this.Database)); Item versionItem = Sitecore.Data.Database.GetItem(versionUri); if (versionItem != null && this.IsCatalogItem(versionItem)) { context.DeleteDocuments(context.Search(new PreparedQuery(this.GetVirtualProductsQuery(versionItem)), int.MaxValue).Ids); } }