Hi,
I have an import task that creates documents if they do not exist or updates them if they do.
When doing an update, in some cases I would like to suppress a smart search task from being added (if a condition matches).
If I wrap the entire task logic in the Execute method with:
using (var context = new CMSActionContext())
{
context.CreateSearchTask = false;
_importService.Import();
}
No search tasks are added (including when new pages are added).
If I add a method to my service to suppress single documents from adding a search task as follows:
public void UpdateDocumentWithoutIndexing(TreeNode document)
{
using (var context = new CMSActionContext())
{
context.CreateSearchTask = false;
document.Update();
}
}
A search task is still being added.
I also tried substituting CMSActionContext with DocumentActionContext with the same result.
Is what I am trying to do possible, or are there any other ideas I can try out?
Thanks,
James