@@ -283,11 +283,8 @@ private int PerformIndexItemsInternal(IEnumerable<ValueSet> valueSets, Cancellat
283283 //this is required to ensure the index is written to during the same thread execution
284284 if ( ! RunAsync )
285285 {
286- //commit the changes
286+ //commit the changes (also refreshes NRT reader and fires IndexCommitted)
287287 _committer . CommitNow ( ) ;
288-
289- // now force any searcher to be updated.
290- WaitForChanges ( ) ;
291288 }
292289 else
293290 {
@@ -515,11 +512,8 @@ private int PerformDeleteFromIndexInternal(IEnumerable<string> itemIds, Cancella
515512 //this is required to ensure the index is written to during the same thread execution
516513 if ( ! RunAsync )
517514 {
518- //commit the changes (this will process the deletes too )
515+ //commit the changes (also refreshes NRT reader and fires IndexCommitted )
519516 _committer . CommitNow ( ) ;
520-
521- // now force any searcher to be updated.
522- WaitForChanges ( ) ;
523517 }
524518 else
525519 {
@@ -794,6 +788,12 @@ public IndexCommiter(LuceneIndex index)
794788 public void CommitNow ( )
795789 {
796790 _index . _writer ? . IndexWriter ? . Commit ( ) ;
791+
792+ // Ensure the NRT reader is refreshed before signaling commit completion.
793+ // Without this, consumers reacting to IndexCommitted may search with
794+ // a stale reader that doesn't yet reflect the committed changes.
795+ _index . WaitForChanges ( ) ;
796+
797797 _index . IndexCommitted ? . Invoke ( _index , EventArgs . Empty ) ;
798798 }
799799
@@ -864,9 +864,6 @@ private void TimerRelease()
864864 {
865865 //perform the commit
866866 CommitNow ( ) ;
867-
868- // after the commit, refresh the searcher
869- _index . WaitForChanges ( ) ;
870867 }
871868 catch ( Exception e )
872869 {
0 commit comments