code: public void close()
     {
        // stop index merger
        // when calling this method we must not lock this MultiIndex, otherwise
        // a deadlock might occur
        if (merger != null)
        {
           merger.dispose();
           merger = null;
        }
        
        synchronized (this)
        {
           try
           {
              // stop timer
              if (flushTask != null)
              {
                 flushTask.cancel();
              }
  
              // commit / close indexes
              try
              {
                 releaseMultiReader();
              }
              catch (IOException e)
              {
                 LOG.error("Exception while closing search index.", e);
              }
              if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE))
              {
                 try
                 {
                    flush();
                 }
                 catch (IOException e)
                 {
                    LOG.error("Exception while closing search index.", e);
                 }
              }
              volatileIndex.close();
              for (int i = 0; i < indexes.size(); i++)
              {
                 (indexes.get(i)).close();
              }
  
              // finally close directory
              try
              {
                 indexDir.close();
              }
              catch (IOException e)
              {
                 LOG.error("Exception while closing directory.", e);
              }
              modeHandler.removeIndexerIoModeListener(this);
              indexUpdateMonitor.removeIndexUpdateMonitorListener(this);
              this.stopped.set(true);
           }
           finally
           {
              // Remove the hook that will stop the threads if they are still running
              SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
              {
                 public Void run()
                 {
                    try
                    {
                       Runtime.getRuntime().removeShutdownHook(hook);
                    }
                    catch (IllegalStateException e)
                    {
                       // can't register shutdown hook because
                       // jvm shutdown sequence has already begun,
                       // silently ignore...
                       if (LOG.isTraceEnabled())
                       {
                          LOG.trace("An exception occurred: " + e.getMessage());
                       }
                    }
                    return null;
                 }
              });
           }
        }
     }
docs: Closes this <code>MultiIndex</code>.