code: private boolean recoveryIndexFromCoordinator() throws IOException
     {
        File indexDirectory = new File(handler.getContext().getIndexDirectory());
  
        try
        {
           IndexRecovery indexRecovery = handler.getContext().getIndexRecovery();
           // check if index not ready
           if (!indexRecovery.checkIndexReady())
           {
              return false;
           }
           //Switch index offline
           indexRecovery.setIndexOffline();
  
           for (String filePath : indexRecovery.getIndexList())
           {
              File indexFile = new File(indexDirectory, filePath);
              if (!PrivilegedFileHelper.exists(indexFile.getParentFile()))
              {
                 PrivilegedFileHelper.mkdirs(indexFile.getParentFile());
              }
  
              // transfer file 
              InputStream in = indexRecovery.getIndexFile(filePath);
              OutputStream out = PrivilegedFileHelper.fileOutputStream(indexFile);
              try
              {
                 DirectoryHelper.transfer(in, out);
              }
              finally
              {
                 DirectoryHelper.safeClose(in);
                 DirectoryHelper.safeClose(out);
              }
           }
           //Switch index online
           indexRecovery.setIndexOnline();
  
           return true;
        }
        catch (RepositoryException e)
        {
           LOG.error("Cannot retrieve the indexes from the coordinator, the indexes will then be created from indexing",
              e);
        }
        catch (IOException e)
        {
           LOG.error("Cannot retrieve the indexes from the coordinator, the indexes will then be created from indexing",
              e);
        }
  
        LOG.info("Clean up index directory " + indexDirectory.getAbsolutePath());
        DirectoryHelper.removeDirectory(indexDirectory);
  
        return false;
     }
docs: Retrieves index from other node.
  
  @throws IOException if can't clean up directory after retrieving being failed