How can we achieve zero downtime indexing using c# code in context of Sitecore during crawling?

I have a custom crawler designed to index items, which is invoked through a scheduler. However, when errors occur during indexing, the search results fail to display records. To address this issue and ensure uninterrupted search functionality, I am planning to implement zero downtime indexing. This approach will allow me to update the search index without disrupting ongoing search operations, thereby maintaining a seamless user experience even during indexing errors or updates.