0

I am adding data in event item:versionAdded and when adding new version then it is calling item:versionAdded event again. For solving this issue I am adding data under:

using (new EventDisabler())
{
--adding record--
} 

However, it is adding data but when we are trying to fetch those data from Content Search API then it is not showing full data. Index is showing half data and when we publish data then it is showing whole data.

Here, I am asking how we can sync index with EventDisabler()

Thanks in advance !!

1

In your case I would use item:versionAdding event instead and not use EventDisabler at all. item:versionAdding event is called before item:versionAdded which you use now. It is used during adding version. All indexing would be then done properly as you are not disabling events.

Another option would be to run rebuild of master index once you are done with your processing.

2
  • 1
    Okay thank and I will try to use item:versionAdding instead of item:versionAdded.
    – Ashish
    Jul 1 '20 at 7:41
  • @Sonu use the voting mechanics, don't leave comments
    – Mark Cassidy
    Jul 30 '20 at 12:27

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.