public boolean flushAndRefresh() throws IOException {
  message("top: now flushAndRefresh");
  Set<String> completedMergeFiles;
synchronized (finishedMergedFiles) {
    completedMergeFiles=Collections.unmodifiableSet(new HashSet<>(finishedMergedFiles));
  }
  mgr.maybeRefreshBlocking();
  boolean result=setCurrentInfos(completedMergeFiles);
  if (result) {
    message("top: opened NRT reader version=" + curInfos.getVersion());
    finishedMergedFiles.removeAll(completedMergeFiles);
    message("flushAndRefresh: version=" + curInfos.getVersion() + " completedMergeFiles="+ completedMergeFiles+ " finishedMergedFiles="+ finishedMergedFiles);
  }
 else {
    message("top: no changes in flushAndRefresh; still version=" + curInfos.getVersion());
  }
  return result;
}

public boolean flushAndRefresh ( ) throws IOException { message ( "top: now flushAndRefresh" ) ; Set < String > completedMergeFiles ; synchronized ( finishedMergedFiles ) { completedMergeFiles = Collections . unmodifiableSet ( new HashSet < > ( finishedMergedFiles ) ) ; } mgr . maybeRefreshBlocking ( ) ; boolean result = setCurrentInfos ( completedMergeFiles ) ; if ( result ) { message ( "top: opened NRT reader version=" + curInfos . getVersion ( ) ) ; finishedMergedFiles . removeAll ( completedMergeFiles ) ; message ( "flushAndRefresh: version=" + curInfos . getVersion ( ) + " completedMergeFiles=" + completedMergeFiles + " finishedMergedFiles=" + finishedMergedFiles ) ; } else { message ( "top: no changes in flushAndRefresh; still version=" + curInfos . getVersion ( ) ) ; } return result ; }
flush all index operations to disk and opens a new near - real - time reader . new nrt point , to make the changes visible to searching . returns true if there were changes .
