code: synchronized boolean hasIndex(String indexName) throws IOException
     {
        // check existing
        for (Iterator<PersistentIndex> it = indexes.iterator(); it.hasNext();)
        {
           PersistentIndex idx = it.next();
           if (idx.getName().equals(indexName))
           {
              return true;
           }
        }
        // check if it exists on disk
        return directoryManager.hasDirectory(indexName);
     }
docs: Returns <code>true</code> if this multi index has an index segment with
  the given name. This method even returns <code>true</code> if an index
  segments has not yet been loaded / initialized but exists on disk.
  
  @param indexName
  the name of the index segment.
  @return <code>true</code> if it exists; otherwise <code>false</code>.
  @throws IOException
  if an error occurs while checking existence of directory.