2

I'm creating a large number of items using Data Exchange Framework (DEF). It looks like the items are being indexed one at a time when created/updated. I have a pipeline step that indexes a subtree of items and would like to stop other pipeline steps from indexing items created by the Resolve Multilanguage Sitecore Item Dictionary Pipeline Step and edited by the Update Sitecore Item Pipeline Step. I can't just wrap the InProcItemModelRepository Create and Update methods with an event disabler because some of them use branch templates and disabling events causes issues when adding from a branch (code doing so can be seen here). I don't want to disable indexing site wide if possible, only for this group of items being added.

2

I created a custom pipeline processor that can be used as the Processor Type for a Iterate Data and Run Pipelines Pipeline Step item. All it really does is wrap the method that runs pipeline steps in the linked pipelines in a BulkUpdateContext which seems to be good enough. I made this change on the standard values of the Iterate Data and Run Pipelines Pipeline Step which is not something everyone should do unless they plan on just using that step to map to Sitecore items which works for my use case. BulkUpdateContext.IsActive was true while debugging through the pipeline steps that created/update items so it looks like this should work for me.

using Sitecore.Data;
using Sitecore.DataExchange.Attributes;
using Sitecore.DataExchange.Contexts;
using Sitecore.DataExchange.Models;
using Sitecore.DataExchange.Plugins;
using System.Collections.Generic;

namespace Common.CustomSitecore.DataExchange.Processors.PipelineSteps
{
    [RequiredPipelineStepPlugins(new[] { typeof(PipelinesSettings), typeof(DataLocationSettings) })]
    [RequiredPipelineContextPlugins(new[] { typeof(IterableDataSettings) })]
    public class IterateAndRunPipelinesStepProcessor : Sitecore.DataExchange.Processors.PipelineSteps.IterateAndRunPipelinesStepProcessor
    {
        protected override void ProcessPipelines(PipelineStep pipelineStep, ICollection<Pipeline> subPipelines,
            PipelineContext pipelineContext)
        {
            using (new BulkUpdateContext())
            {
                base.ProcessPipelines(pipelineStep, subPipelines, pipelineContext);
            }
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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