An employee asked this question, and I did not immediately find a solution, so I post it here. It programmatically inserts a Sitecore element into the main database, and then subsequently has to insert another element that is dependent on the first element present in the index. Initially, he had an insert of the second insert every time or two, but since then he inserted a manual pause in his code to try to catch up with the index time, and now he fails only about the tenth time. Better, but not perfect.
He is looking for a way for Sitecore to check whether the index is updated before it starts to insert the dependent element.
I found this blog post by Alex Shyba ( http://sitecoreblog.alexshyba.com/2011/04/search-index-troubleshooting.html ), which looks like it might have some applicability, but my colleague is strictly working in the main The database (without publication), and we already have the first few steps in the Alex article implemented in our solution (I did not go through all this).
source share